我正试图在Ubuntu 16.04上使用我的计算机和一些同行运行更快的R-CNN。 但我被卡住了。 我在谷歌上找不到像我这样的错误。
Normalizing targets
done
Solving...
Traceback (most recent call last):
File "./tools/train_net.py", line 96, in <module>
max_iters=args.max_iters)
File "/home/david/Faster-RCNN_TF/tools/../lib/fast_rcnn/train.py", line 222, in train_net
sw.train_model(sess, max_iters)
File "/home/david/Faster-RCNN_TF/tools/../lib/fast_rcnn/train.py", line 95, in train_model
rpn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(rpn_cls_score, rpn_label))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1686, in sparse_softmax_cross_entropy_with_logits
labels, logits)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1535, in _ensure_xent_args
"named arguments (labels=..., logits=..., ...)" % name)
ValueError: Only call `sparse_softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)
我不知道这是什么错误以及如何解决此错误。 请帮帮我
答案 0 :(得分:0)
而不是:
rpn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(rpn_cls_score, rpn_label))
尝试写作:
tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(rpn_label, rpn_cls_score))
如果它不起作用,请尝试:
tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=rpn_label, logits=rpn_cls_score))