tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [84]
在配置SSD进行训练自己的数据集时出现的问题.
查找到的解决方案有:
(1)Try deleting any checkpoints that were saved from previous runs. Sometimes when changing the architecture and running again, TF will pick up from the old checkpoint (but with new definition), and you get this error.
(2)I also ran into this problem, the problem was that the labels and class numbers didn't matched so I changed and fix the class number cound and labels everywhere.In my case it was to change the "num_classes" parameter in the faster_rcnn.config and the "label_map.pbtxt" file to match with the real values.
(3)So as it happens, I had updated the TensorFlow code but had failed to train it. So I rolled back to the previous version, made the appropriate new changes to the run script and got it working.
经过排查与尝试,最终发现是自己的标签问题,我自己训练的是3类,而SSD原始代码是21类,而我只改了部分地方,因此只需要将代码里的类别全部改成3即可.