-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LayoutLM3] How to export models to onnx format? #1274
Comments
Same issue, I want to convert LayoutLMv3 Object Detection model to ONNX. But not getting any help: The final error I'm getting is
|
same question, Has it been resolved? |
same question, Has it been resolved? |
I successfully converted the model to ONNX and even applied quantization using the Optimum CLI tool. I used the following commands: Conversion: pip install --upgrade --upgrade-strategy eager optimum[onnxruntime]
optimum-cli export onnx -m microsoft/layoutlmv3-large --task token-classification layoutlmv3-large-onnx Quantization: optimum-cli onnxruntime quantize --onnx_model layoutlmv3-large-onnx --avx2 -o layoutlmv3-large-onnx-quantized More info about quantization here I noticed that RAM usage dropped and the speed increased slightly, though it’s still not as fast as running it on a GPU. I'm currently working on compiling the model to run on AWS INF1 (Inferentia) instances. If anyone has ideas or wants to collaborate, (issue inf1) I’d really appreciate the help.! |
optimum-cli only supports “bin” and other model formats, but the object detection model of layoutlv3 is a “pth” format model. How did you convert the format? |
Describe
Model I am using (LayoutLM3):
I've tried the solutions provided by Detectron2 and Hugging Face, but I haven't been successful in exporting the model for the "Document Layout Analysis on PubLayNet" task to the ONNX format. I'm hoping to receive assistance from the community on this matter.
The text was updated successfully, but these errors were encountered: