Input shape changed after converting model to tflite
anyone? :(  Hey friend, please wait, I believe good things will come to you. Hi VanBap, can you upload your .h5 and .tflite file? That will help me test this faster. > Hi VanBap, can you upload your .h5 and .tflite file? That will help me test this faster.

I cant upload model files here because they are >25MB even though I zipped those. 
But they are on my Github: 
- model .tflite: https://github.com/VanBap/Adverse_Weather/tree/master/saved_model 
- training model .h5: https://github.com/VanBap/Adverse_Weather/blob/master/Detection_model_usingResNet50.ipynb

By the way when I try to run model .tflite, I just put a new line code:
" # Resize Tensor Shape
interpreter.resize_tensor_input(input_details[0]['index'], (1, 224, 224, 3)) "
then it finally ran but I dont really know (how) does it affect the way my model .tflite processing ?!

 Hi @VanBap, in your notebook you do not specify a specific input_shape in the API: https://keras.io/api/applications/resnet/#resnet50-function, Resizing the converted input shape is actually expected: https://www.tensorflow.org/lite/guide/inference#run_inference_with_dynamic_shape_model, so given your parameters, I believe resizing is the correct action. Does that answer your concerns? Thanks. > Hi @VanBap, in your notebook you do not specify a specific input_shape in the API: https://keras.io/api/applications/resnet/#resnet50-function, Resizing the converted input shape is actually expected: https://www.tensorflow.org/lite/guide/inference#run_inference_with_dynamic_shape_model, so given your parameters, I believe resizing is the correct action. Does that answer your concerns? Thanks.

I really appreciate your help! I am trying your answer and will feed back when its done > Hi @VanBap, in your notebook you do not specify a specific input_shape in the API: https://keras.io/api/applications/resnet/#resnet50-function, Resizing the converted input shape is actually expected: https://www.tensorflow.org/lite/guide/inference#run_inference_with_dynamic_shape_model, so given your parameters, I believe resizing is the correct action. Does that answer your concerns? Thanks.

Hi pkgoogle, I just want to feedback that I have tried your answer and my model ran properly. Thank u so much. I really appreciate it! Hi @VanBap, no worries, if you have no more open items, please feel free to close as completed. Thanks.
### 1.  My topic

- Image Classification to detect 7 different  weather conditions deploy on Raspberry Pi4

### 2. Train model .h5 on ggcolab 
- I'm using ResNet50 (deep learning) and 1 fully connected layer with Softmax function
- Input: (244, 244, 3) image 
- Output: one-hot encoding 7 classes (Ex: [0 0 1 0 0 0 0 0] => Rainy)
- epoch = 20 and accuracy is 90% (code below)
- Then I convert model .h5 to .tflite in order to run on RaspberryPi4

### 3. Problem
- input_details[0]['shape'] gave me input shape: " [1, 1, 1, 3] " which is wrong (correct one is [1, 244, 244, 3] ) 
- output_details[0]['shape'] gave me output shape:  " [1, 7] " which is correct
=> model.tflite run wrong

### How can I fix this bug? ( change input shape of model .tflite to exact input shape )

### Link my code on github: https://github.com/VanBap/Adverse_Weather 
Including: 
- File train model h5: Adverse_weather_detection_model.ipynb
- File convert model from .h5 -> .tflite: convert.py
- File run test model .tflite: run_tflite_model.py

Thank you so much!
