Can i export a VisionEncoderDecoder checkpoint to onnx
Can I export any hugging face checkpoint to onnx? If not, how do I go about it@nielsrI want to export trocr checkpoint to onnx, is it possible.I tried doing the same with a fine-tuned checkpoint of mine, it gives a KEY ERRORKeyError: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>When I do the same using “microsoft/trocr-large-printed” checkpoint, I get an exception sayingonnx_export_fail903×479 76.9 KBDo you know what might I be missing? Is it possible, if not , how do I go about it.
2021-12-16T09:50:42Z
Pinging@lewtunhere, to let him know people are also interested in exporting EncoderDecoder model classes to ONNX.
2021-12-17T12:02:24Z
You can track the issuehere@Kforcode
2022-05-25T16:53:29Z
Hey there! Any updates on this?I’ve read throughthis documentationabout implementing a custom ONNX configuration for unsupported architectures. The walk-through described here doesn’t look too difficult. But, I decided that before I attempted this I’d ask: is this possible with TrOCR in its current state, or is this irrelevant until the code is refactored (which I know you smart people are working on currently, and I thank you for it)?
2022-05-27T15:11:11Z
We’re currently refactoring the internals of the ONNX exporter to handle multimodal models betterhere. Once that’s done, it should be relatively straightforward to export TrOCR and I’d be happy to guide you on that
2022-05-27T17:41:52Z
Oh wonderful! Thanks!
2022-06-14T19:31:41Z
Hi there,I am unable to export a fine-tuned TrOCR checkpoint as per thedocumentationfor custom architectures. Is there a way to go about it?
2022-08-13T01:06:35Z
I don’t know if anyone still needs it, but I cobbled together a rough script to convert some TrOCR models to ONNX.Here it is. Hopefully it can help someone out.
2022-10-05T10:23:47Z
Hi there@lewtun@nielsr, it would be cool if we can do the same forDonutmodel.In addition, it would be cool to have also the posibility for optimum-intel.I would be glad to help as it is Hacktoberfest
2022-10-31T08:03:40Z
VisionEncoderDecoderModel now has ONNX support, thanks to this PR:https://github.com/huggingface/transformers/pull/19254.