昇腾310P3运行paddleocr出现coredump #14508
Replies: 4 comments
-
你这个是转的模型精度不对,ATC 转换的那步里,得手动指定一下精度,问题定位应该是模型转的精度和代码对不上,可以尝试一下 |
Beta Was this translation helpful? Give feedback.
-
没有转换模型,用来paddle npu插件:pip install paddle-custom-npu -i https://www.paddlepaddle.org.cn/packages/nightly/npu |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
根据您描述的 "昇腾310P3运行PaddleOCR出现coredump" 问题,结合提供的日志信息和运行环境,我们可以分析出以下问题的可能原因及解决方案: 问题分析
解决方案1. 检查和升级环境
2. 修改代码适配NPU
3. 使用优化后的模型
4. 验证环境配置
5. 替代方案:在CPU上运行
参考链接如果按上述解决方案仍无法解决问题,请提供更多日志信息,例如:
Response generated by feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
-
🔎 Search before asking
🐛 Bug (问题描述)
昇腾310P3运行paddleocr出现Coredump,操作步骤参考如下链接:(https://blog.csdn.net/qq_54958500/article/details/143500816?spm=1001.2014.3001.5502)
运行出错截图如下:
🏃♂️ Environment (运行环境)
CPU:Kunpeng
NPU:Ascend 310P
系统:麒麟4.19.90-52.22.v2207.ky10.aarch64
CANN版本:8.0.RC1
驱动版本:24.1.rc3
Python:3.9.21
paddle-custom-npu:3.0.0b2
paddleocr:2.8.1
paddlepaddle:3.0.0b1
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
1、拉取镜像
docker pull registry.baidubce.com/device/paddle-npu:cann80RC1-ubuntu20-aarch64-gcc84-py39
2、启动容器
docker run -it --name paddle-npu-dev -v $(pwd):/work
--privileged --network=host --shm-size=128G -w=/work
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
-v /usr/local/dcmi:/usr/local/dcmi
-e ASCEND_RT_VISIBLE_DEVICES="0,1,2,3,4,5,6,7"
registry.baidubce.com/device/paddle-npu:cann80RC1-ubuntu20-$(uname -m)-gcc84-py39 /bin/bash
3、安装paddle NPU 插件包
pip install paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu
pip install paddle-custom-npu -i https://www.paddlepaddle.org.cn/packages/nightly/npu
4、检查安装版本
python -c "import paddle_custom_device; paddle_custom_device.npu.version()"
5、下载图片
wget https://paddleocr.bj.bcebos.com/dygraph_v2.1/ppocr_img.zip
unzip ppocr_img.zip
6、运行如下代码
1)、PaddleOCR对象构建时设定use_gpu=True,出现coredump,日志如上面截图。
/root/Ascend/log日志如下,提示类型不支持:
[ERROR] OP(13821,python):2024-12-26-09:31:47.631.022 [cube_util.cpp:44][NNOP][CheckSocSupportDtype][13821] errno[161002] OpName:[aclnnConvolution_0] The soc version does not support bf16 / fp32 for calculations, please change the setting of cubeMathType or the Dtype of input tensor.
[ERROR] OP(13821,python):2024-12-26-09:31:47.631.173 [aclnn_convolution.cpp:1394][NNOP][Check][13821] errno[561000] OpName:[aclnnConvolution_0] check CheckCubeMathType(upperDtype, engine.params.cubeMathType) failed.
[ERROR] OP(13821,python):2024-12-26-09:31:47.631.180 [aclnn_convolution.cpp:1489][NNOP][CheckConvParams][13821] errno[561000] OpName:[aclnnConvolution_0] check ret == ACLNN_SUCCESS failed.
[ERROR] OP(13821,python):2024-12-26-09:31:47.631.186 [aclnn_convolution.cpp:2689][NNOP][aclnnConvolutionGetWorkspaceSize][13821] errno[161002] OpName:[aclnnConvolution_0] Check Param failed
将img修改为fp16类型,即修改推理代码如下:
img = np.asarray(img, dtype=np.float16)
result = ocr.ocr(img, cls=True)
运行未报错,但是完全没有输出结果,ascend日志未发现错误,运行日志如下截图:
2)、如设定use_gpu=False或不设置该参数,可以正常在CPU上运行,日志截图如下:
Beta Was this translation helpful? Give feedback.
All reactions