zzh8829/yolov3-tf2

无法进行训练:“does not index into shape”

huiji123 opened this issue · 2 comments

详细情况如下

tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[16] = [13, 51, 1, 2] does not index into shape [16,26,26,3,6]
[[{{node PartitionedCall_1/TensorScatterUpdate}}]]
[[IteratorGetNext]] [Op:__inference_train_function_28256]

Function call stack:
train_function

请问我应该改如何进行修改?

你好,我也遇到这个问题了,请问你解决了吗?谢谢

I am not sure if it will be your case, but in mine this error was caused by not-normalized tensor values (in some cases they were outside of range [0.0;1.0]).
TF Object Detection API requires all the bounding box coords to be normalized according to image shape. More info here: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/using_your_own_dataset.md
You also have to remember, that each of image/object/*/* arrays passed to tf.train.Example must have same sizes. If you modified any part of the tools/voc2012.py, double check this case does not appear.