When I used Yolo3+mobileNet，after training I got yolov3_mobilenet.weights. I am trying to convert those weights to tensorflow using this command
python convert_weights_pb.py --class_names myData.names --data_format NHWC --weights_file my_mobile_yolov3-tiny_100.weights
But I am getting this error
Traceback (most recent call last):
File "convert_weights_pb.py", line 56, in <module>
File "C:\Users\86178\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\86178\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 300, in run
File "C:\Users\86178\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 251, in _run_main
File "convert_weights_pb.py", line 46, in main
load_ops = load_weights(tf.global_variables(scope='detector'), FLAGS.weights_file)
File "E:\my_darknet_IR\utils.py", line 115, in load_weights
(shape, shape, shape, shape))
ValueError: cannot reshape array of size 4665440 into shape (1024,512,3,3)
Any help will be appreciated
Dear yu, jia,
May I know where you are getting this Yolo3+mobileNet model ? The Model Optimizer Yolo Documentation was written with https://github.com/mystic123/tensorflow-yolo-v3 in mind so I don't expect it would work with some other model without modifications. Can you kindly provide more details ?
My own network modified on the basis of tiny_yolov3, the following attachment is my .weights file, I use the following command to convert the .weights file to .pb
Please help me to see how to solve it. If you need a network structure and other documents, can you send it to you privately?
Dear yu, jia,
May I ask why you wouldn't use the validated and supported yolo V3 that is recommended by the OpenVino team ? Unfortunately I cannot help you with convert_weights_pb.py (unless it's really simple and obvious) since that's not an OpenVino tool. This forum is dedicated to OpenVino, namely Model Optimizer and Inference Engine. This mystic123 issue seems rather similar to yours. Maybe it will help you.