matthewearl / deep-anpr

Using neural networks to build an automatic number plate recognition system
MIT License
1.85k stars 697 forks source link

train.py ERROR #70

Open MyraBaba opened 7 years ago

MyraBaba commented 7 years ago

I have :

Traceback (most recent call last): File "/Users/alpullu/Downloads/deep-anpr/train.py", line 266, in initial_weights=initial_weights) File "/Users/alpullu/Downloads/deep-anpr/train.py", line 174, in train digits_loss, presence_loss, loss = getloss(y, y) File "/Users/alpullu/Downloads/deep-anpr/train.py", line 132, in get_loss [-1, len(common.CHARS)])) File "/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1558, in softmax_cross_entropy_with_logits labels, logits) File "/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1512, in _ensure_xent_args "named arguments (labels=..., logits=..., ...)" % name) ValueError: Only call softmax_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

my tensorflow version : 1.3

MansourTrabelsi commented 7 years ago

Hi!

Change the whole line with this line : digits_loss = tf.nn.softmax_cross_entropy_with_logits( logits=tf.reshape(y[:, 1:], [-1, len(common.CHARS)]), labels=tf.reshape(y_[:, 1:], [-1, len(common.CHARS)]))

ranju2015 commented 6 years ago

@MansourTrabelsi Not really working.

dfroze commented 6 years ago

@ranju2015 could you share more details? I encountered 2 locations with similar error (sigmoid_cross_entropy_with_logits and softmax_cross_entropy_with_logits), and after fixing as @MansourTrabelsi said, it worked.