How to store TensorRT engine file for re-use? #16623
Replies: 3 comments 9 replies
-
What paddlepaddle version is used? |
Beta Was this translation helpful? Give feedback.
-
Hey @Bobholamovic ! Here are the versions across the board. Python version: 3.10
|
Beta Was this translation helpful? Give feedback.
-
I believe I've gotten a little farther, I think using the paddlex_config to load into PaddleOCR(paddlex_config). it looks like in hpi_config, there is a backend_config that allows me to put in trt_cfg_setting. However I'm still unsure which is the tensorRT engine file I searched through my FS and found these trt files - are these the engine files I can cache and reference at PaddleOCR runtime?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently my GPU cold starts for PaddleOCR with TensorRT take up to 10 minutes (as I'm assuming it is building the engine)
TRT is able to successfully initialize with this below
self._ocr_model = PaddleOCR( use_tensorrt=True, enable_hpi=True, use_angle_cls=True, lang='en', ocr_version="PP-OCRv5", text_detection_model_name='PP-OCRv5_mobile_det', text_det_limit_type="min", text_det_limit_side_len=960, use_doc_orientation_classify=False, use_doc_unwarping=False, )
However everytime the GPU boots up it takes 10 minutes to load. I'm wondering if I can cache the TRT engine to reuse everytime the GPU gets spun up.
It looks like this block of code (config.enable_tensorrt_engine)
PaddleOCR/tools/infer/utility.py
Line 324 in eaede68
allows a parameter called use_static=True, which documentation
use_static,type:bool, and the default value is False. If it is designated as True, then the optimized TRT information will be serialized to the disk during the first run of the program, and will be directly loaded next time without regeneration.
How do I pass this param through python's paddleocr.PaddleOCR()?
Beta Was this translation helpful? Give feedback.
All reactions