tf-Faster-RCNN
tf-Faster-RCNN copied to clipboard
InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [101 1] [y (losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [101]
Hi, I'm trying to train clutteredMNIST of gray images with ResNet 50 V1 model, using the command "python faster_rcnn_conv5.py -n 10 -e 20 -y 'clutteredMNIST.yml' ",however the error below occured "InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [101 1] [y (losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [101]"
waiting online
have you solved this issue?
I have the same problem by using faster_rcnn_conv5.py -n 0 -e 5 as given in the example. Has anyone else solved this issue yet? Thanks.
Me 2. Running example on MacOS Mojave and python 3.6.4.
I also got this problem. I run in python 3.5.2, tensorflow-gpu 1.8.0, My ubuntu version is 16.04
find fast_rcnn_cross_entropy=tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=tf.squeeze(fast_rcnn_cls_score), labels=labels)) in loss_functions.py change to fast_rcnn_cross_entropy=tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=tf.squeeze(fast_rcnn_cls_score), labels=tf.argmax(labels, 1)))
Would u plz tell us why it works? it truly works! Thanks!
在 loss_functions.py中找到fast_rcnn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits = tf.squeeze(fast_rcnn_cls_score),labels = labels)) 更改为 fast_rcnn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits = tf.squeeze) (fast_rcnn_cls_score),labels = tf.argmax(labels,1)))
你能告诉我们它为什么有效吗?它确实有效!谢谢!
不好意思,刚刚看了下这好像是个错误的方法我等会会删除,你可以看一下labels的输出,可能是因为这方面的原因。
在 loss_functions.py中找到fast_rcnn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits = tf.squeeze(fast_rcnn_cls_score),labels = labels)) 更改为 fast_rcnn_cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits = tf.squeeze) (fast_rcnn_cls_score),labels = tf.argmax(labels,1)))
你能告诉我们它为什么有效吗?它确实有效!谢谢!
不好意思,刚刚看了下这好像是个错误的方法我等会会删除,你可以看一下labels的输出,可能是因为这方面的原因。
应该是: fast_rcnn_cross_entropy = tf.reduce_mean( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=tf.squeeze(fast_rcnn_cls_score), labels=tf.squeeze(labels))) 吧,因为sparse_softmax_cross_entropy_with_logits要求标签的维度是[batch_size]大小,这里需要把label的形状reshape一下