# Modify the model input format in a .tflite file generated by the run\_image\_classification.py script

**URL:** <https://discuss.huggingface.co/t/modify-the-model-input-format-in-a-tflite-file-generated-by-the-run-image-classification-py-script/88356>\
**Category:** 🤗Transformers\
**Created:** [May 24, 2024, 9:41pm UTC](https://discuss.huggingface.co/t/modify-the-model-input-format-in-a-tflite-file-generated-by-the-run-image-classification-py-script/88356 "2024-05-24T21:41:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreramos7](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/andreramos7/32/27335_2.png) [@andreramos7](https://discuss.huggingface.co/u/andreramos7)\
**Post date:** [May 24, 2024, 9:41pm UTC](https://discuss.huggingface.co/t/modify-the-model-input-format-in-a-tflite-file-generated-by-the-run-image-classification-py-script/88356/1 "2024-05-24T21:41:21Z")

</div>

For image classification applications on Android, the input needs to be in the form [1,224,224,3], but .tflite file generated by Hugginface scritp receives it in the form [1,3,224,224].  
How to change this?  
the model input format in a .tflite file generated by the run\_image\_classification.py script and  
`model = TFMobileViTForImageClassification.from_pretrained`  
and  
`converter = tf.lite.TFLiteConverter.from_keras_model(model)`  
this file is “channel first”. How to modify it so that it is “channel last”?  
See the shape of the input in the image of the .tflite file  
 ![base_input_mobileViT](https://us1.discourse-cdn.com/hellohellohello/original/3X/1/f/1f842d6a25909c263a38085f65a417a7b257d7fa.png)
