Skip to content

Instantly share code, notes, and snippets.

/-

Created March 10, 2017 21:42
Show Gist options
  • Save anonymous/062721cae29f62ab7262ceb1d0e66a59 to your computer and use it in GitHub Desktop.
Save anonymous/062721cae29f62ab7262ceb1d0e66a59 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "example_feat_extract.py", line 64, in <module>
main(net)
File "example_feat_extract.py", line 56, in main
features = model.predict(melgrams)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/engine/training.py", line 1272, in predict
batch_size=batch_size, verbose=verbose)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/engine/training.py", line 945, in _predict_loop
batch_outs = f(ins_batch)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 959, in __call__
return self.function(*inputs)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/theano/compile/function_module.py", line 871, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/theano/compile/function_module.py", line 859, in __call__
outputs = self.fn()
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/theano/gof/op.py", line 912, in rval
r = p(n, [x[0] for x in i], o)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/theano/tensor/basic.py", line 4397, in perform
(x.shape, shp))
ValueError: Cannot reshape input of shape (1366,) to shape [ 1 1 96 1]
Apply node that caused the error: Reshape{4}(bn_0_freq_running_mean, TensorConstant{[ 1 1 96 1]})
Toposort index: 18
Inputs types: [TensorType(float16, vector), TensorType(int64, vector)]
Inputs shapes: [(1366,), (4,)]
Inputs strides: [(2,), (8,)]
Inputs values: ['not shown', array([ 1, 1, 96, 1])]
Outputs clients: [[Elemwise{Composite{(((i0 - i1) * i2) + i3)}}(input_1, Reshape{4}.0, Elemwise{Composite{(i0 / sqrt(clip((i1 + i2), i3, i4)))}}.0, Reshape{4}.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "example_feat_extract.py", line 64, in <module>
main(net)
File "example_feat_extract.py", line 50, in main
model = MusicTaggerCNN(weights='msd', include_top=False)
File "/home/nartes/Documents/current/music-auto_tagging-keras/music_tagger_cnn.py", line 90, in MusicTaggerCNN
x = BatchNormalization(axis=freq_axis, name='bn_0_freq')(melgram_input)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/engine/topology.py", line 635, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/engine/topology.py", line 166, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/layers/normalization.py", line 133, in call
broadcast_running_mean = K.reshape(self.running_mean, broadcast_shape)
File "/home/nartes/Documents/current/music-auto_tagging-keras/tmp/env/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 587, in reshape
y = T.reshape(x, shape)
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment