I've marked this question as answered even though I am still struggling to get the model converted property (input shape seems to get messed up along the way). Even the pretrained yolov3, yolov3-tiny, yolov4, and yolov4-tiny conversions do not seem to be working with the yolo2openvino repository at this stage.
After some alterations to the requirements.txt file to fix the numerous compatibility warnings and errors, I am still having issues.
Python version (using pyenv):
Python 3.7.17
Updated requirements.txt:
tensorflow==1.14.0
numpy~=1.15.0
blobconverter==1.2.7
protobuf<=3.20
Pillow==9.5.0
gast~=0.2.0
Operating system: Ubuntu 22.04.5 LTS
Conversion command (example provided in the repo):
python convert_weights_pb.py \
--yolo 3 \
--class_names coco.names \
--output yolov3.pb \
--weights_file yolov3.weights \
--size 416
Traceback (most recent call last):
File "convert_weights_pb.py", line 94, in <module>
tf.app.run()
File "/home/adriaan/.pyenv/versions/yolo2openvino_lux/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/adriaan/.pyenv/versions/yolo2openvino_lux/lib/python3.7/site-packages/absl/app.py", line 308, in run
_run_main(main, args)
File "/home/adriaan/.pyenv/versions/yolo2openvino_lux/lib/python3.7/site-packages/absl/app.py", line 254, 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 "/mnt/d/Github/External/luxonis/yolo2openvino/utils/utils.py", line 113, in load_weights
(shape[3], shape[2], shape[0], shape[1]))
ValueError: cannot reshape array of size 5628441 into shape (5604,1024,1,1)
I have forked the repo here and will continue to try and update the tool for darknet yolov4-tiny conversion for those that wish to convert models trained with the hank-ai/darknet repository.
Wish me luck!