New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convolution expects input with rank 4, got 5 #39
Comments
which version of tensorflow |
related to issue 38 maybe? |
@imranparuk Yes. Thanks for pointing it out. |
It's a versioning problem. |
@astorfi hi another question: problem about Squeeze spatially to eliminate extra dimensions.(embedding layer)
a error happened , could I USE logits = tf.squeeze(logits, name='fc/squeezed') instead? |
Hi @dzfowen , the code works out the box, you do not need to change anything. Your issue is that you have the incorrect version of numpy+tensorflow. This will be eventually sorted out i'm sure but for now what you need to do is use a virtual environment, uninstall numpy, install tensorflow version 1 which ships with its own numpy. This should fix your issues. |
@imranparuk Hi! Thanks for your reply. I mean if I delete [1,2,3], the squeeze() will have the same function as the author's intention, is it right? The new api of squeeze() asked provided specific dimension must contain a 1 at least. |
@dzfowen, no problem. I think it is possible to get the implementation working without the spatial squeeze, it seems to just be there to speed up training (The author should comment its use in more depth). However if python is complaining about dimensions with regard to the squeeze or any other portions of the model it is a good indication that your source of error is due to the mismatch in tensorflow and numpy versions. |
Convolution expects input with rank 4, got 2 |
Traceback (most recent call last):
File "./code/1-development/train_softmax.py", line 602, in
tf.app.run()
File "/opt/tensorflow/python2.7/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "./code/1-development/train_softmax.py", line 414, in main
logits, end_points_speech = model_speech_fn(batch_speech[i * step: (i + 1) * step])
File "/opt/speaker-recognition/code/1-development/nets/nets_factory.py", line 59, in network_fn
return func(images, num_classes, is_training=is_training)
File "/opt/speaker-recognition/code/1-development/nets/cnn_speech.py", line 118, in speech_cnn
net = slim.conv2d(inputs, 16, [3, 1, 5], stride=[1, 1, 1], scope='conv11')
File "/opt/tensorflow/python2.7/local/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 183, in func_with_args
return func(*args, **current_args)
File "/opt/tensorflow/python2.7/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1154, in convolution2d
conv_dims=2)
File "/opt/tensorflow/python2.7/local/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 183, in func_with_args
return func(*args, **current_args)
File "/opt/tensorflow/python2.7/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1025, in convolution
(conv_dims + 2, input_rank))
ValueError: Convolution expects input with rank 4, got 5
The text was updated successfully, but these errors were encountered: