Is there a way to create a confusion Matrix on Tflite Model Maker - Image Classification that is similar to Audio Classification?
Take a look at those notebooks for showing confusion matrix with sklearn and matplotlib:
Finally this one with Model maker classes:
I think by combining you can print confusion matrix also for Image Classification task.
Hi I followed the 3rd notebook and I get this error.
AttributeError: 'ImageClassifier' object has no attribute 'confusion_matrix'
Maybe ‘ImageClassifier’ object has no attribute 'confusion_matrix then. So create it customly by following the 2 first notebook with sklearn and matplotlib.
What I would, while it’s not available on the ImageClassifier, is to copy what AudioClassifier is doing: examples/audio_classifier.py at 1ff6d7aa9bdf9749ada28bf67ad435ca518b6232 · tensorflow/examples · GitHub
the code might be easy to copy/adapt
Where will I put the code? Inside the image_classifier.py? or just in another cell in Jupyter Notebook?
I’d just create another cell with a function.
that is the easiest solution
I put it inside the image_classifier.py and it worked. Will that be fine?
I guess so, if it’s working for you that’s enough, right?
Create a PR with that fix.
I am getting the same error “AttributeError: ‘ImageClassifier’ object has no attribute ‘confusion_matrix’” when I put it in another cell, I think putting it inside image_classifier.py would be fine since there’s no error and ‘model.confusion_matrix’ worked since I put it inside the image_classifier.py. I just thought it will break the package, but it worked. Thank you so much for the help guys!
Checkout this link Quantization in tensorflow-lite | Tensor Examples