AssertionError: failed to read all data
Hello, thank you for this YOLO implementation, it's quite impressive. As I'm working through it I ran into a problem. I downloaded the weights as instructed, they are in the directory where image_demo.py is, but when executing the image_demo.py I get the following error from utils.load_weights :
assert len(wf.read()) == 0, 'failed to read all data' AssertionError: failed to read all data
Can you please give me a hint how to resolve it? It seems like the weights are not read correctly. I am on windows 10 if that matters.
It works fine on both Mac and Linux. sorry I have no idea about it.
Thanks for the reply!
For those who are seeing this issue: just comment out the assert statement, it still works! The weights load correctly but for some reason the assert statement fails. image_demo.py still produces the expected result
Hmmm, I'm getting the same issue. Except when I comment out the assert statement, I get the following error:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 5577 values, but the requested shape requires a multiple of 85 [[node Reshape_5 (defined at /PycharmProjects/conduct/YOLOV3/video_demo.py:51) ]] [Op:__inference_keras_scratch_graph_13283]
Any ideas?
Just figured out what went wrong. In video_demo.py, you have to change the number of classess manually, on line 24. Could this be changed so that it automatically reads the classes file from the config and determines the number of classes?
You need have the original number of coco classes to load the model. this happened to me when i changed the classes from the config to run yymnist training classes.