yolov3.weights loading error
I ran the image_demo.py, when loading the weights file, an error occurred in the row utils.load_weights(model, "yolov3.weights")
The error:
File "D:/YOLOV3/image_demo.py", line 40, in
I ran the image_demo.py, when loading the weights file, an error occurred in the row utils.load_weights(model, "yolov3.weights")
The error:
File "D:/YOLOV3/image_demo.py", line 40, in utils.load_weights(model, "yolov3.weights") File "D:\YOLOV3\core\utils.py", line 59, in load_weights assert len(wf.read()) == 0, 'failed to read all data'
I also have this problem. Do you solve it?
I ran the image_demo.py, when loading the weights file, an error occurred in the row utils.load_weights(model, "yolov3.weights")
The error:
File "D:/YOLOV3/image_demo.py", line 40, in
utils.load_weights(model, "yolov3.weights") File "D:\YOLOV3\core\utils.py", line 59, in load_weights assert len(wf.read()) == 0, 'failed to read all data'
Try to reload weights.
before assert to sleep(4)
When it happened to me I had config __C.YOLO.CLASSES = "./data/classes/yymnist.names" instead of __C.YOLO.CLASSES = "./data/classes/coco.names" in core.config.py
I use this code in Tensorflow 2.2 and Keras 2.2.4 and it works properly.
Use this command for saving weights:
model.save_weights("{model_name}.ckpt")
Then load model using:
model.load_weights("{model_name}.ckpt")
Instead of:
utils.load_weights(model, "/yolov3")
You should specify your "model_name"!
Good luck!