ImageAI icon indicating copy to clipboard operation
ImageAI copied to clipboard

Unable to evaluate mAP scores

Open willm9 opened this issue 4 years ago • 3 comments

Hi, I've just been following along the documentation here: https://imageai.readthedocs.io/en/latest/customdetection/ to try and train a custom object detector.

I've just finished training and now want to evaluate the models. However, I'm just getting outputs like this:


Evaluation samples: 97 Using IoU: 0.5 Using Object Threshold: 0.3 Using Non-Maximum Suppression: 0.5 QIS: 0.0000 mAP: 0.0000

WARNING:tensorflow:No training configuration found in the save file, so the model was not compiled. Compile it manually.


I'm not sure where to go from here and hope I don't have to retrain everything again.

willm9 avatar May 01 '21 05:05 willm9

Did you set the JSON path correctly? The JSON file is in the cache folder created by image ai itselfScreenshot_20210501-085801_1.png

ekesdf avatar May 01 '21 06:05 ekesdf

Yes, I've set the JSON path correctly and can see it in the cache folder

willm9 avatar May 01 '21 08:05 willm9

Here is a potential workaround if you are getting an mAP of 0.0 at the evaluation step (and have verified the h5 model and the training/evaluation data is not corrupted):

  • Flush the workspace cache with: !rm -r .../<name_of_workspace>/cache/ During the evaluation step, ImageAI will recreate this folder along with the .pkl files. Between model training and evaluation, sometimes the file becomes "corrupted", which will give a default mAP of 0.0. Flushing the cache after training resolved this issue every time it occurred for me.

TheBeastCoding avatar Jan 20 '22 19:01 TheBeastCoding