I trained a model on Colab for my final year project EfficientNetB0. After all the layer training, I tested it and its result was excellent, but now I want to integrate the model to the frontend web app backed by python Flask. For integration I used AI but I am facing the one error:
Bone model not loaded: Input 0 of layer "stem_conv" is incompatible with the layer: expected axis -1 of input shape to have value 3, but received input with shape (None, 385, 385, 1)
I tried AI help from last 2 days. Followed Different approaches suggested by AI but couldn't get the results.
Solutions/Approaches I followed:
- Modifications to model loading and image preprocessing code
- Patched the currently trained model : Tried to wrap image preprocessing inside model
- Inspected frontend libraries
- and multiple ones I cant remember others
My main evil err is:
Input Shape Mismatch (384 vs 385, grayscale vs RGB)
Problem: Model expects (384,384,3), but some inputs were (385,385,1) or grayscale
Model output on Colab:

Model error on frontend:

Right now I haven't tried to retrain the model using modifications. I don't know if it will give same output as this one after those modifications. My expected result was to achieve the same output received on Colab.