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

Cannot feed value of shape () for Tensor 'input/x-input:0', which ha s shape '(1, 3072)' in TensorFlow #2

Open
hitesha14 opened this issue Jul 20, 2018 · 0 comments

Comments

@hitesha14
Copy link

hitesha14 commented Jul 20, 2018

Hello Joel Lutman,@jhole89

I get the following shape error when I am trying to run the CNN Classifier code. However I have tried all means of resolving it, but I wasn't able to resolve it at all. I have few images that I am trying to classify. I am using image size as 32. I have tried with different image sizes on my custom dataset, however I face similar issue everytime.

Please see the below stack trace of the error. I would be very grateful if you could please help me out with it.

INFO:root:Loading resource: Images [C:\Users\hits\cnn_classifier\Output\images\t
rain]
img_size 3072
length of data 32
WARNING:tensorflow:From C:\Users\hits\cnn_classifier\cnn_model.py:171: softmax_c
ross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and w
ill be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

WARNING:tensorflow:From C:\Users\hits\cnn_classifier\cnn_model.py:171: softmax_c
ross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and w
ill be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

WARNING:tensorflow:From C:\Users\hits\cnn_classifier\cnn_model.py:189: calling a
rgmax (from tensorflow.python.ops.math_ops) with dimension is deprecated and wil
l be removed in a future version.
Instructions for updating:
Use the axis argument instead
WARNING:tensorflow:From C:\Users\hits\cnn_classifier\cnn_model.py:189: calling a
rgmax (from tensorflow.python.ops.math_ops) with dimension is deprecated and wil
l be removed in a future version.
Instructions for updating:
Use the axis argument instead
2018-07-20 16:08:52.728842: I T:\src\github\tensorflow\tensorflow\core\platform
cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow bi
nary was not compiled to use: AVX2
WARNING:root:Resource not found: CNN Model [C:\Users\hits\cnn_classifier\Output
tmp\tensorflow/cnn/model\model.ckpt]. Model will now be trained from scratch.
Tensor("cost/Mean:0", shape=(), dtype=float32) {<tf.Tensor 'input/x-input:0' sha
pe=(1, 3072) dtype=float32>: 1, <tf.Tensor 'input/y_true:0' shape=(1, 2) dtype=f
loat32>: 1, <tf.Tensor 'input/Placeholder:0' shape= dtype=float32>: 1.0
}
Traceback (most recent call last):
File "main.py", line 47, in
train(image_directory, model_directory)
File "C:\Users\hits\cnn_classifier\cnn_model.py", line 264, in train
checkpoint_path=os.path.join(checkpoint_dir, 'model.ckpt'))
File "C:\Users\hits\cnn_classifier\cnn_model.py", line 79, in log_progress
val_loss = session.run(cost, feed_dict=test_feed_dict)
File "C:\Users\hits\Anaconda3\lib\site-packages\tensorflow\python\client\sessi
on.py", line 900, in run
run_metadata_ptr)
File "C:\Users\hits\Anaconda3\lib\site-packages\tensorflow\python\client\sessi
on.py", line 1111, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape () for Tensor 'input/x-input:0', which ha
s shape '(1, 3072)'

@jhole89

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

1 participant