【问题标题】:‘Tensor’ object has no attribute ‘reshape’“张量”对象没有“重塑”属性
【发布时间】:2020-02-28 11:49:26
【问题描述】:

我正在研究音频分类领域的蒙面条件神经网络。我正在尝试通过以下方式重塑张量

concatenated_segments = mini_batch.reshape((segment_count * segment_length, feature_count))

但我收到以下错误:

‘Tensor’ object has no attribute ‘reshape’

按照其他地方的建议,我也尝试使用以下

concatenated_segments = T.reshape(mini_batch, (segment_count * segment_length,feature_count))

其中 T 代表:import theanofrom theano import tensor as T。但是,这并不能解决问题,因为它得到了错误

Cannot convert (Dimension(None), Dimension(256)) to TensorType', <class 'tuple'> 

我正在使用 Theano

有关更多详细信息,我正在尝试理解和运行出版物Masked Conditional Neural Networks for Audio Classification中的代码。代码可在此处获得:GitHub-Repo。所有库版本都与 Git 描述匹配。上述行在 Layer.py 模块中。

【问题讨论】:

    标签: reshape theano tensor


    【解决方案1】:

    你可以试试tensorflow版本https://github.com/fadymedhat/MCLNN。这有更多更新的库。

    【讨论】:

      猜你喜欢
      • 2018-06-20
      • 2019-08-11
      • 2019-03-08
      • 2019-07-03
      • 2018-06-06
      • 2019-05-12
      • 2020-10-22
      • 2019-02-20
      • 2017-12-06
      相关资源
      最近更新 更多