Exporting OCR Predictor (det+rec) as ONNX (inference on CPU) #1243
Replies: 4 comments 4 replies
-
Hi @zohaib-khan5040 👋🏼 , Using half precision is currently only possible on the main branch:
The whole But you can export the detection and recognition model seperatly (Attention: the models are exported up to the logits there is no postprocessing included - this would be on your own at the moment) detection: recognition: We have on track to build something like a |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the respone! Yes, only after a few hours did I realize that exporting only works for the individual models, not the Predictor as a whole. Could you please help me with understanding how I could ONNX each of the components of the OCR Predictor? I understand that there are If there is any example you could direct me to within this repo that could help with ONNXing the entire pipeline, I would appreciate this immensely! 🙏 |
Beta Was this translation helpful? Give feedback.
-
If there's any convenient ways of using half precision on the CPU, whether that be converting to ONNX then using OpenVINO or using bfloat16, for the end-to-end pipeline specifically, please let me know here. I've been trying to convert the DBResNet50 and CRNN models to ONNX but there're so many moving pieces with the huge number of classes and nuances with the output of the detector being |
Beta Was this translation helpful? Give feedback.
-
I was able to reproduce this issue (half + cuda works well but on cpu some layers doesn't support fp16 on cpu) i will try to find a solution for this. About bfloat16 hard to handle for me because i don't have a cpu which supports bfloat16 ^^ Have you tested if the autocast works with float16 instead of bfloat16 on cpu ? |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm using the
ocr_predictor
class to run an end-to-end text recognition task but am running into a lot of errors and warnings when I try to perform this. My aim is to export to ONNX to run the end-to-end inference in half precision.If there are any examples related to exporting such a model, please help me out - I was unable to find anything in the repo. If there are any alternatives for running half precision inference on the CPU, that would be very appreciated (I was unable to run bfloat16 inference with the same model).
The code:
Beta Was this translation helpful? Give feedback.
All reactions