Paddle2ONNX icon indicating copy to clipboard operation
Paddle2ONNX copied to clipboard

ppocr4 paddle转onnx模型后在cpu上的推理速度远大于在gpu的推理速度

Open Number18-tong opened this issue 1 year ago • 2 comments

用下面的三个命令生成ppocr4的onnx模型后,用cuda providers推理的速度很慢,用cpu providers推理的速度更快一些,请问是什么原因导致的呢?

paddle2onnx命令:

paddle2onnx --model_dir ch_PP-OCRv4_det_infer --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file ppocr4_det_0926.onnx --opset_version 16 --enable_onnx_checker True

paddle2onnx --model_dir ch_PP-OCRv4_rec_infer --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file ppocr4_rec_0926.onnx --opset_version 16 --enable_onnx_checker True

paddle2onnx --model_dir ch_ppocr_mobile_v2.0_cls_infer --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file ppocr4_cls_0926.onnx --opset_version 16 --enable_onnx_checker True

Number18-tong avatar Sep 27 '24 07:09 Number18-tong

遇到了一样的问题,cpu和GPU速度差不多

zaixia108 avatar Oct 17 '24 12:10 zaixia108

实际测试之后发现,在识别不同图片时会发生十几倍甚至几十倍的速度减慢 After actual testing, it was found that a dozen or even tens of times slowdown occurs when recognizing different images

zaixia108 avatar Oct 25 '24 13:10 zaixia108

我也遇到了 使用rust的ort在cpu上2秒,在gpu上10秒。

carlos-yuan avatar Nov 14 '24 08:11 carlos-yuan

我也遇到了 使用rust的ort在cpu上2秒,在gpu上10秒。

如果你是在win上使用,可以考虑尝试一下使用directml推理,我尝试dml速度是正常的

zaixia108 avatar Nov 14 '24 09:11 zaixia108

image 检测慢第一次调用FFI很慢,后面识别的时候,不同文本有的快有的慢,随机的。 image 同一张图片第二次识别就会很快。但是换一张图片依旧很慢。 不知道是Onnx运行时的问题,还是转换成onnx的问题。

carlos-yuan avatar Nov 15 '24 01:11 carlos-yuan

image 检测慢第一次调用FFI很慢,后面识别的时候,不同文本有的快有的慢,随机的。 image 同一张图片第二次识别就会很快。但是换一张图片依旧很慢。 不知道是Onnx运行时的问题,还是转换成onnx的问题。

是的,我跟你同样问题,使用cuda速度就是会很慢,甚至比不上CPU,但是使用directml之后速度就正常了

zaixia108 avatar Nov 15 '24 04:11 zaixia108

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 16 '24 02:12 github-actions[bot]

Still experiencing the problem, is there any possible solutions?

zaixia108 avatar Dec 16 '24 03:12 zaixia108

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jan 17 '25 02:01 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jan 31 '25 02:01 github-actions[bot]