TFLite Conversion
Is there any way to convert TrOCR model to TFLite version? I was trying to convert it to ONNX first with Transformers ONNX, but in the list I only found Vision Encoder Decoder model so kind of wondering about this one. Planning to embed it on mobile device. Also, is there any way to reduce the size of the model that we had trained without losing any accuracy?
2023-04-04T10:23:21Z
Details:I stumbled upon#19604. However, it’s a bit different. In my case, I used thetrainer.savefunction to save my finetuned TrOCR model. As a result, I got the checkpoint files and also these files:config.json
generation_config.json
preprocessor_config.json
pytorch_model.bin
training_args.binCommand I used:python -m transformers.onnx --model=trocr/base/ --feature=vision2seq-lm onnx/ --atol 1e-3Error that I still got:ValueError: Unrecognized feature extractor in trocr/base/. Should have a `feature_extractor_type` key in its preprocessor_config.json of config.json, or one of the following `model_type` keys in its config.jsonIn theconfig.json, I have bothtrocrandvision-encoder-decoderas the model type, which is not included in the list given by the  error.