-
Notifications
You must be signed in to change notification settings - Fork 25
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: Shape (128, 4, 10) must have rank 2 #3
Comments
Hi Samir, Sorry to be late for replying, when I ran this program, there was nothing wrong about it, have you converted the training data into tfrecords files correctly? I have had a copy in my pc at school but it's holiday now and I'm at home so I can't get access to it, but maybe I can help you produce your own training images. |
@zakizhou Thanks for answering me, Actually I tried it a commit before you start to use these tfrecord files. |
I really can't get access to the preproduced training data so I'd like to help you create it and it is not difficult. |
Later after creating jpgs or pngs, see the |
Thanks a lot! it worked I just generated the tfrecords files, but I am still getting some problem to evaluate a model... |
You're welcome. |
I want to send an image to a trained model in order to get its prediction |
OK,I know what you what.
here
this will give you the probability distributions over all possible labels in the you can also change the inputs into 'tf.placeholder' and later pass a |
Hello zakizhou! |
Hello,
I've just got follow error after I tried to execute this command:
python model/captcha_train.py
Can you help with this? I am sorry if it is a silly question, but I am just getting started to work with TensorFlow...
Traceback (most recent call last):
File "model/captcha_train.py", line 82, in
main()
File "model/captcha_train.py", line 44, in main
loss = captcha_model.loss(logits, labels)
File "/home/samir/Downloads/CAPTCHA/model/captcha_model.py", line 123, in loss
cross_entropy_per_number = tf.nn.softmax_cross_entropy_with_logits(logits, labels)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 491, in softmax_cross_entropy_with_logits
precise_logits, labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 1427, in _softmax_cross_entropy_with_logits
features=features, labels=labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2319, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 603, in _SoftmaxCrossEntropyWithLogitsShape
input_shape = logits_shape.merge_with(labels_shape).with_rank(2)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 641, in with_rank
raise ValueError("Shape %s must have rank %d" % (self, rank))
ValueError: Shape (128, 4, 10) must have rank 2
The text was updated successfully, but these errors were encountered: