Replies: 1 comment 3 replies
-
|
Hi, as far as I understand, the .nb file is a runtime package generated by the Paddle-Lite opt tool. It bundles the model structure and weights into a single file and also includes device-specific optimizations. Once you only have the .nb file, there’s no way to convert it back to a .pdmodel/.pdiparams pair or directly to ONNX. So before running the Paddle-Lite optimizer, it’s important to keep the original Paddle inference model (either dynamic or static). As for exporting an INT8 QAT model to a standard Paddle inference model, after finishing quant-aware training (QAT) with PaddleSlim, you should still have a Python training script that looks roughly like this: This will generate two files: quant_infer_model.pdmodel and quant_infer_model.pdiparams. Make sure to keep both of them. If you want to convert the saved INT8 inference model to ONNX, once you have the .pdmodel/.pdiparams files, you can install the official paddle2onnx tool: pip install paddle2onnx Then you can run something like: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
Due to runtime issues, I need to use a PPOCRv5 model as a quantised variant. In order to minimise the loss of accuracy caused by quantisation, I would like to perform quant-aware training.
If I understand correctly, this will result in an .nb model. Is there a way to convert my int8 model to the normal PaddleOCR format, or somehow to the onnx format?
Or are there other ways to significantly speed up the runtime of my PPOCR models?
I would be very grateful for a reply. Thanks
Beta Was this translation helpful? Give feedback.
All reactions