jsalbert / Music-Genre-Classification-with-Deep-Learning

Using deep learning to predict the genre of a song.
https://jsalbert.github.io/Music-Genre-Classification-with-Deep-Learning/
MIT License
158 stars 38 forks source link

tagger_net.py #4

Open iamkj03 opened 6 years ago

iamkj03 commented 6 years ago

Hi, I'm trying to work on your codes but have a problem.

Basic informations are tensorflow : 1.8 (But I have tried 1.2, 0.12) theano:0.82 (also tried 0.9) keras: 1.1

The problem I'm having is the value error. ValueError: total size of new array must be unchanged. It looks like dimension problem but can't solve it.

Using Theano backend. /usr/local/lib/python2.7/dist-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "quick_test.py", line 36, in model = MusicTaggerCRNN(weights=None, input_tensor=(1, 96, 1366)) File "/home/lg/Downloads/Music-Genre-Classification-with-Deep-Learning-master/tagger_net.py", line 116, in MusicTaggerCRNN x = Reshape((15, 128))(x) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 514, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 152, in create_node output_shapes = to_list(outbound_layer.get_output_shape_for(input_shapes[0])) File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 304, in get_output_shape_for return (input_shape[0],) + self._fix_unknown_dimension(input_shape[1:], self.target_shape) File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 299, in _fix_unknown_dimension raise ValueError(msg) ValueError: total size of new array must be unchanged

Does anybody solve this problem?

simson1 commented 5 years ago

I have same issue.you should add "image_dim_ordering": "th" in keras json file.It worked for me by using theano backend.

vk7055 commented 5 years ago

I have same issue. @simson1 I changed my keras.json to

{ "image_dim_ordering": "th", "backend": "theano", "floatx": "float32", "epsilon": 1e-07 }

Before doing this, I did the change suggested in https://github.com/jsalbert/Music-Genre-Classification-with-Deep-Learning/issues/3#issuecomment-383325484 by @akhil1312

But I am still getting the same issue as stated above.