I think your train/validation split is a little bit weird. (That doesn’t affect the issue you are mentioning)
given that you want to convert to TFLite and it looks like it’s a simple image classification model, I’d suggest you try using Model Maker. It will take care of converting the model and doing all the magic for you. It will also make it easier to use it with the Task Lib
If you decide to use Model Maker, you can use a MobileNetV3 model spec (the model is available on TF Hub).
Thanks for the answers Gus. Of course you helped me. I also follow you on Twitter and love your tweets. But I wonder why the test/train set split is weird, could you explain?
Thanks for the information, I will try model maker but I’m wondering where I’m wrong.
I’m sorry the Colab link I shared didn’t save my latest work, so it showed sketchy work. I updated the link again, those who want to help can take a look.
Your train/test split was pointing to the same data so the model would train and test on the same data and that gives a wrong perspective of the quality of your model.
Did you had time to try Model Maker? that might help you!
I guess the problem of always predicting the same class is caused by the MobilenetV3. By making Preprocessing False, I normalized the images myself to a range of [-1,1] and the model is working fine.
I tried ModelMaker and downloaded the model from TF Hub, it makes the process easier a lot. I will probably use it in my next projects. Thank you to everyone who helped.