blog
blog copied to clipboard
How to get/extract CONCRETE FUNCTIONS from my model? (In order to convert my model into TFLite)
Hi, i saved my model in these 3 followings ways:
from transformers import ViTFeatureExtractor, ViTForImageClassification
from transformers import AutoModelForImageClassification
from transformers import TFAutoModelForImageClassification
model_directory = "drive/MyDrive/Tirocinio/1ris_vit-stanford-dog-dataset"
tokenizer = ViTFeatureExtractor.from_pretrained(model_directory)
model = ViTForImageClassification.from_pretrained(model_directory)
pytorch_path = "drive/MyDrive/Tirocinio/ViT_model_pytorch"
model_pytorch = ViTForImageClassification.from_pretrained(pytorch_path)
h5_path = "drive/MyDrive/Tirocinio/ViT_model_tf"
model_h5 = ViTForImageClassification.from_pretrained(h5_path, from_tf=True)
now what i want to do is get the concrete function in order to convert my model into a TFLite model.
can you please tell me how to do it?
Hey there! Thanks for the question! This question would go better in the forums :) https://discuss.huggingface.co/