luxonis / yolo2openvino

YoloV3, YoloV4, YoloV3-tiny, and YoloV4-tiny conversion to Tensorflow and OpenVINO.
MIT License
10 stars 9 forks source link

ValueError: cannot reshape array of size 372388 into shape (256,256,3,3) #4

Closed Nicoladao closed 2 years ago

Nicoladao commented 2 years ago

hello, when i run like this: python convert_weights_pb.py --yolo 4 --voc.data --output yolov4-duck.pb --weights_file /yolov4-tiny-duck_last.weights --size 416 and error occur!: Traceback (most recent call last): File "convert_weights_pb.py", line 94, in tf.app.run() File "/home//anaconda3/envs/change/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home//.local/lib/python3.6/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/home//.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "convert_weights_pb.py", line 78, in main load_ops = load_weights(tf.global_variables(scope='detector'), FLAGS.weights_file) File "/home//Documents/ceprei/yolo2openvino/utils/utils.py", line 113, in load_weights (shape[3], shape[2], shape[0], shape[1])) ValueError: cannot reshape array of size 372388 into shape (256,256,3,3)

how can i fix it?

thank you!

tersekmatija commented 2 years ago

Hey @Nicoladao , from the name it seems as you are trying to convert a YoloV4-tiny model?

If that's the case, you are missing --tiny flag. Also, I think just using --voc.data could cause error. I think it would be better to use --class_names path/to/voc.names.

Nicoladao commented 2 years ago

Hey @Nicoladao , from the name it seems as you are trying to convert a YoloV4-tiny model?

If that's the case, you are missing --tiny flag. Also, I think just using --voc.data could cause error. I think it would be better to use --class_names path/to/voc.names.

nice work!! I add the flag and use 'voc.name',it is worked! thank you!!