ImageAI
ImageAI copied to clipboard
Unable to evaluate mAP scores
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.
Did you set the JSON path correctly?
The JSON file is in the cache folder created by image ai itself
Yes, I've set the JSON path correctly and can see it in the cache folder
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.