deep-anpr icon indicating copy to clipboard operation
deep-anpr copied to clipboard

train.py ERROR

Open MyraBaba opened this issue 7 years ago • 3 comments

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 = get_loss(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

MyraBaba avatar Sep 30 '17 23:09 MyraBaba

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)]))

MansourTrabelsi avatar Oct 01 '17 20:10 MansourTrabelsi

@MansourTrabelsi Not really working.

ranju2015 avatar Jul 24 '18 04:07 ranju2015

@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.

dfroze avatar Aug 16 '18 08:08 dfroze