Skip to content
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

ValueError: Cannot feed value of shape (48, 48, 1) for Tensor u'InputData/X:0', which has shape '(?, 48, 48, 1)' #1

Open
RABAJ opened this issue Aug 25, 2018 · 7 comments

Comments

@RABAJ
Copy link

RABAJ commented Aug 25, 2018

hi! I am getting this error after running poc.py .Please help me .

@jalajthanaki
Copy link
Owner

jalajthanaki commented Aug 25, 2018

Can you help me with the which Tensorflow version and TFLearn version are you using?

Meanwhile you can check this Stackoverflow thread to resolve this issue.

I'm trying to recreate the same error at my end so I can provide the solution of it.

@RABAJ
Copy link
Author

RABAJ commented Aug 25, 2018

first i was working on tensorflow version 1.7 but now i upgraded it to 1.10 still getting error:-
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tflearn/initializations.py:119: UniformUnitScaling.init (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tflearn/objectives.py:66: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead

@RABAJ
Copy link
Author

RABAJ commented Aug 25, 2018

I had already reshaped using( image = image.reshape([-1, SIZE_FACE, SIZE_FACE, 1])
print(image.shape))and getting output(1,48,48,1)but after it when it goes to model.predict it raises the error :- Cannot feed value of shape (48, 48, 1) for Tensor u'InputData/X:0', which has shape '(?, 48, 48, 1)'

@RABAJ
Copy link
Author

RABAJ commented Aug 25, 2018

using these-
absl-py==0.2.0
astor==0.6.2
bleach==1.5.0
gast==0.2.0
grpcio==1.11.0
html5lib==0.9999999
Keras==2.1.5
Markdown==2.6.11
numpy==1.14.2
opencv-python==3.4.0.12
pandas==0.22.0
Pillow==5.1.0
protobuf==3.5.2.post1
python-dateutil==2.7.2
pytz==2018.4
PyYAML==3.12
scikit-learn==0.19.1
scipy==1.0.1
six==1.11.0
sklearn==0.0
tensorboard==1.7.0
tensorflow==1.7.0
termcolor==1.1.0
tflearn==0.3.2
Werkzeug==0.14.1

@jalajthanaki
Copy link
Owner

jalajthanaki commented Aug 27, 2018

I'm running the same code which I have uploaded and unfortunetly I couldn't recreate the same error which you are getting.

I'm using tensorflow-gpu==1.9.0

You can see this solution as well

Try to pass image[none,48,48,1] and check.

Bare with me for a day or two I will setup the same enviornment which you had and get back to you.

@jalajthanaki
Copy link
Owner

I have checked the code from my side. I used the library specifications which you have posted and the code is running perfectly fine. I haven't changed anything so I guess if you can experiment with reshape then this issue will be solved. If you should probably use the batch dimension that may help. More details about this is given here and here

@jalajthanaki
Copy link
Owner

@RABAJ: If I get to know the entire error log then it would be great. So I can try another time to see what is creating problem in your case.

My assumptions:
The input image size in your case is also 48 X 48
You haven't change the defination of neural network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants