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 (0,) for Tensor 'Placeholder_1:0', which has shape '(?, 180)' #1

Open
861 opened this issue Jul 18, 2017 · 4 comments

Comments

@861
Copy link

861 commented Jul 18, 2017

Hi, I use tensorflow(1.2.1),it‘s my first time to using tensorflow,I just want to run your code for learing,but I met the error:

Traceback (most recent call last):
File "E:\captcha-breaker-master\captcha_train.py", line 252, in
train()
File "E:\captcha-breaker-master\captcha_train.py", line 218, in train
smry, _, l = sess.run([merged, optimizer, loss], feed_dict={x: batch[0], y: batch_labels})
File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 789, in run
run_metadata_ptr)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 975, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (0,) for Tensor 'Placeholder_1:0', which has shape '(?, 180)'

@vitorarins
Copy link
Owner

Hi @861. Do you have images to train the model? Can you send me a sample of those images?

You will need about 500k images properly labeled. If you want I can help you in the process of training the model.

@861
Copy link
Author

861 commented Jul 18, 2017

Yes,I have labeld about 500k images in train folder,you can give me the email ,so I can send them to you!

@ghost
Copy link

ghost commented Dec 27, 2017

I'm using TensorFlow 1.4.0 and wanted to use your code to learn and eventually try to play around with.
Oddly enough, your code (with some name changes etc.) did work for me once, but my CPU was overstrained, so I decided to run it with my GPU (CUDA 8.0) - since then, I get the same error message on both CPU and GPU.

@ghost
Copy link

ghost commented Dec 27, 2017

After playing around a bit I was able to solve this problem by using the absolute paths to the train and test folders (as well as the summary directory just for safety).
Sadly I am not very good with programming in Python, so I cannot say why your code does not work in this regard. I also do not know if my solution makes it slower etc. but at least this problem is solved :D

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