hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

Yolov4 Evaluation returns an mAP of 0 #395

Open milanpatel25 opened 2 years ago

milanpatel25 commented 2 years ago

I am having an issue with Yolov4. I downloaded the weights, and convert to pb. I create the dataset and do the preprocessing of the dataset. Then I run the command python evaluate.py --weights ./checkpoints/yolov4-416 I then do python remove_space.py And python main.py --output results_yolov4_tf An I just get a total mAP of 0, I have attached the results txt file. results.txt Is this a known problem, am I missing a step or do I need to change something? Any help would be appreciated, thanks! Tensorflow version: 2.6.0

Sebastian514 commented 2 years ago

Your issue may happen during converting the weights. In savemodel.py, go to the 51st row and replace utils.load_weights(model, FLAGS.weights, FLAGS.model, FLAGS.tiny) with model.load_weights(FLAGS.weights) . Then redo what the demo.

milanpatel25 commented 2 years ago

Thanks for the speedy reply!

I get an issue from this line:

OSError: Unable to open file (file signature not found)

I have tried redownloading the weights file but I get the same error.

Edit: My colleague says he managed to do the workflow with this amend but says he got the same result (mAP of 0), I will verify with him as to why I got an error and he didnt.

Sebastian514 commented 2 years ago

Rolling back your tf version as decribed in requirements-gpu.txt may be helpful.

I met the same mAP issue before. However ,my issue only came out when I used the weights that was automatically saved during training instead of the default weights. After my correction as above ,the mAP issue was solved. However, it was still poor(about 42%). But it's another thing.

naruto-raj commented 2 years ago

facing the same issue with yolov4-tiny, any updates on this. although the tflite detections give good results.