tensorflow-yolov3
tensorflow-yolov3 copied to clipboard
yolov3_coco_demo.ckpt evaluate error
Thanks for your sharing! when I evaluate my data with yolov3_coco_demo.ckpt(ReadMe providede the link),I meet some errors that I can not solve by adding tf.global_variables_initializer() and some other ops.
the config file that I have set,and my data just 1 class. the "./data/dataset/tfyolo_test_all.txt" format refer to the readme.md.
__C.YOLO.CLASSES = "./data/classes/coco.names" __C.YOLO.ANCHORS = "./data/anchors/coco_anchors.txt"
__C.TEST.ANNOT_PATH = "./data/dataset/tfyolo_test_all.txt" __C.TEST.WEIGHT_FILE = './ckpt0/yolov3_coco_demo.ckpt'
the errors as follow:
Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1356, in _do_call return fn(*args) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1341, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[{{node save/Assign_93}}]] [[save/RestoreV2/_344]] (1) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[{{node save/Assign_93}}]] 0 successful operations. 0 derived errors ignored.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1286, in restore {self.saver_def.filename_tensor_name: save_path}) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 950, in run run_metadata_ptr) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1173, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1350, in _do_run run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1370, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[node save/Assign_93 (defined at evaluate.py:50) ]] [[save/RestoreV2/_344]] (1) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[node save/Assign_93 (defined at evaluate.py:50) ]] 0 successful operations. 0 derived errors ignored.
Errors may have originated from an input operation. Input Source operations connected to node save/Assign_93: conv_mbbox/weight (defined at /mnt/MountVolume1/xielu/code_hub/codes/gitsfile/tensorflow-yolov3-master/core/common.py:31)
Input Source operations connected to node save/Assign_93: conv_mbbox/weight (defined at /mnt/MountVolume1/xielu/code_hub/codes/gitsfile/tensorflow-yolov3-master/core/common.py:31)
Original stack trace for 'save/Assign_93':
File "evaluate.py", line 168, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "evaluate.py", line 168, in
2 root error(s) found. (0) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[node save/Assign_93 (defined at evaluate.py:50) ]] [[save/RestoreV2/_344]] (1) Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,512,255] rhs shape= [1,1,512,18] [[node save/Assign_93 (defined at evaluate.py:50) ]] 0 successful operations. 0 derived errors ignored.
Errors may have originated from an input operation. Input Source operations connected to node save/Assign_93: conv_mbbox/weight (defined at /mnt/MountVolume1/xielu/code_hub/codes/gitsfile/tensorflow-yolov3-master/core/common.py:31)
Input Source operations connected to node save/Assign_93: conv_mbbox/weight (defined at /mnt/MountVolume1/xielu/code_hub/codes/gitsfile/tensorflow-yolov3-master/core/common.py:31)
Original stack trace for 'save/Assign_93':
File "evaluate.py", line 168, in
if I set the config as this: __C.YOLO.CLASSES = "./data/classes/tfyolo.names" __C.YOLO.ANCHORS = "./data/anchors/tfyolo_anchors.txt"
__C.TEST.ANNOT_PATH = "./data/dataset/tfyolo_test_all.txt" __C.TEST.WEIGHT_FILE = './ckpt0/yolov3_coco_demo.ckpt'
No error in evaluate.py,but the map=0.0%
I got this problem, then change self.trainable: True in evaluate.py. In my case, it's solved
you set is ture ,but in evaluate.py line 124,class_name is coco name.you shuould conver class_name to tfyolo.names. like me: class_name = self.coco_classes[class_ind] if class_name in self.voc_classes: class_name = class_name else: continue hope its can help you! @chunniunai220ml