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
vgg.load_weights(VGG_Weights_path) Error: input shapes: [102400,4096], [25088,4096] #3
Comments
Yes, This error is because of the Tensorflow backend. We don;t support tensorflow backend currently. Try installing latest version of nvcc and theano. |
@VeniVidiGavi did you discover how to solve it? .. I got the same error |
@anas-899 @VeniVidiGavi I just removed the arguments |
@noamgal It works well, thanks! I got another error after the fix AttributeError: 'itertools.cycle' object has no attribute 'next', but changes to next(zipped) at "/image-segmentation-keras/LoadBatches.py" and now it works. |
If you remove the input_width and input_height it will simply use the default size of 224x224 I believe. |
Yes default values don't work. Just go to /home/.keras/keras.json and change to |
Then you'll be changing your backend to Theano. Some people can't use Theano (for example if you want to train on Google Cloud ML). |
Ye you won't be able to train on google cloud, but since authors state "We don't support tensorflow backend currently" i don't see other option |
This error happens because VGG16 was designed for images with size of 224. But the given code uses Input(shape=(3,416,608). If you do not replace the input shape with (3,224,224),you will meet the error that "ValueError: Dimension 0 in both shapes must be equal, but are ***** and 25088 for 'Assign_26' (op: 'Assign') with input shapes: [****,4096], [25088,4096]".Remove arguments input_width and input_height for both train.py and predict.py and it worked well becasue the train.py and predict.py use default arguments" 224".I find the code don't support tensorflow backend because tensorflow uses "channels_last" and theano uses "channels_first" .So if you want the code support tensorflow backend,just change input shape with (224,224,3) and change "data_format='channels_first'" with " data_format='channels_last". @VeniVidiGavi @anas-899 @quelibrio @gpkc |
@Cbanyungong Why is it exactly that makes it necessary to keep the size 224? Aren't CNNs kernel-based and therefore independent of input size (i.e. they just train the kernel weights)? |
I'm getting this error in Line 105 of the FCN8 ( o = Add()([ o , o2 ])): Any ideas why this is happening? I try to use tensorflow as backend aswell and did everything mentioned in this post. |
Have you solved the problem? |
@mgq1507 you can try to replace zipped.next() with zipped._next_() in LoadBatches.py |
CNNs are indeed independent of input size, but VGG net is not fully convolutional. It has some fully-connected layers at the end. At the time of flattening the input the mismatch of the shape occur. |
Image segmentation keras has been updated. The new version should fix the issue. |
I am getting an error at the line:
vgg.load_weights(VGG_Weights_path)
the error is:
ValueError: Dimension 0 in both shapes must be equal, but are 102400 and 25088 for 'Assign_26' (op: 'Assign') with input shapes: [102400,4096], [25088,4096].
Please note that:
I am running Keras with the Tensorflow backend because, with the Theano backend, I am getting an error which causes Theano to run on the CPU rather thsan the GPU (and only on 1 Core of the CPU).
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 2, ....
The text was updated successfully, but these errors were encountered: