PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
40.34k stars 7.47k forks source link

Jetson TX2 NX 使用GPU预测没问题,使用TRT就卡住 #13234

Open iFish85 opened 1 week ago

iFish85 commented 1 week ago

问题描述 / Problem Description

跟这个问题一样:https://github.com/PaddlePaddle/PaddleOCR/issues/12590

使用GPU预测时没有问题 但是在打开TensorRT后运行到I0603 6020 engine.cc:301 Run Paddle-TRT Dynamic Shape mode. 会卡很久。 但是在第一次运行时不存在 trt_det_shap.txt,trt_cls_shap.txt,trt_rec_shao.txt这三个shap文件时就是正常的加载时间,

回复中有人提到 确保配置的动态形状范围合理,请问如何配置?LOG中没有任何动态范围的报错。

运行环境 / Runtime Environment

复现代码 / Reproduction Code

./build/ppocr --det_model_dir=inference/det --rec_model_dir=inference/rec \ --use_angle_cls=false --det=true --rec=true --cls=false \ --image_dir=test_img/1.jpg \ --use_gpu=true --gpu_mem=512 --use_tensorrt=true --cpu_threads=4 \ --det_db_score_mode=fast --precision=fp32 \ --benchmark=true --limit_side_len=480 \ --visualize=false --rec_batch_num=10

完整报错 / Complete Error Message

可能解决方案 / Possible solutions

附件 / Appendix

first.log second.log

GreatV commented 1 week ago

trt 要 cache 不同的图片尺寸,所以会慢。

iFish85 commented 1 week ago

trt 要 cache 不同的图片尺寸,所以会慢。

不是慢,是卡住完全不动了