yolov4-deepsort icon indicating copy to clipboard operation
yolov4-deepsort copied to clipboard

Error in conversing custom weights of yolov4

Open Akash3194 opened this issue 3 years ago • 2 comments

I am getting error like below while using my own yolov4 weights model, i have already replace .names file with my own in core config file. In my model i have just 1 class. The error i am getting is below.

A service 0x3cf2520 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-06-10 15:18:21.048305: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version Traceback (most recent call last): File "save_model.py", line 58, in app.run(main) File "/home/aakash_tyagi/PycharmProjects/tensorflow-yolov4-tflite/venv/lib/python3.6/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/home/aakash_tyagi/PycharmProjects/tensorflow-yolov4-tflite/venv/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "save_model.py", line 54, in main save_tf() File "save_model.py", line 49, in save_tf utils.load_weights(model, FLAGS.weights, FLAGS.model, FLAGS.tiny) File "/home/aakash_tyagi/PycharmProjects/tensorflow-yolov4-tflite/core/utils.py", line 63, in load_weights conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 4457630 into shape (1024,512,3,3)

Akash3194 avatar Jun 10 '21 10:06 Akash3194

You will probably have to change the line:

https://github.com/theAIGuysCode/yolov4-deepsort/blob/9e745bfb3ea5e7c7505cb11a8e8654f5b1319ad9/core/config.py#L14

with the name of the obj.names file you have created

jmudy avatar Jun 11 '21 11:06 jmudy

Go in file coco.names, delete all classes and insert the name of classes you have been trained image

denmarquess avatar Jul 27 '21 13:07 denmarquess