PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.25k stars 5.59k forks source link

昇腾910B上运行ocr报错,基础健康检查通过 #69247

Closed liyang051 closed 3 days ago

liyang051 commented 4 days ago

bug描述 Describe the Bug

paddle 使用3.0.0b2分支源码编译,arm架构,操作系统为ubuntu20.04

测试代码

from paddleocr import PaddleOCR, draw_ocr
import time

# Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
# 例如`ch`, `en`, `fr`, `german`, `korean`, `japan`
ocr = PaddleOCR(use_angle_cls=True,use_npu=True, lang="ch")  # need to run only once to download and load model into memory
img_path = './imgs/11.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
    res = result[idx]
    for line in res:
        print(line)

测试命令

paddleocr --image_dir ./imgs/11.jpg --use_angle_cls true --use_gpu false --use_npu true

报错信息

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   paddle::AnalysisPredictor::ZeroCopyRun(bool)
1   paddle::framework::NaiveExecutor::RunInterpreterCore(std::vector<std::string, std::allocator<std::string > > const&, bool, bool)
2   paddle::framework::InterpreterCore::Run(std::vector<std::string, std::allocator<std::string > > const&, bool, bool, bool, bool)
3   paddle::framework::PirInterpreter::Run(std::vector<std::string, std::allocator<std::string > > const&, bool, bool, bool, bool)
4   paddle::framework::PirInterpreter::TraceRunImpl()
5   paddle::framework::PirInterpreter::TraceRunInstructionList(std::vector<std::unique_ptr<paddle::framework::InstructionBase, std::default_delete<paddle::framework::InstructionBase> >, std::allocator<std::unique_ptr<paddle::framework::InstructionBase, std::default_delete<paddle::framework::InstructionBase> > > > const&)
6   paddle::framework::PirInterpreter::RunInstructionBase(paddle::framework::InstructionBase*)
7   paddle::framework::PhiKernelInstruction::Run()
8   phi::KernelImpl<void (*)(phi::CustomContext const&, std::vector<phi::DenseTensor const*, std::allocator<phi::DenseTensor const*> > const&, paddle::experimental::ScalarBase<phi::DenseTensor> const&, phi::DenseTensor*), &(void custom_kernel::ConcatKernel<float, phi::CustomContext>(phi::CustomContext const&, std::vector<phi::DenseTensor const*, std::allocator<phi::DenseTensor const*> > const&, paddle::experimental::ScalarBase<phi::DenseTensor> const&, phi::DenseTensor*))>::Compute(phi::KernelContext*)
9   void custom_kernel::ConcatKernel<float, phi::CustomContext>(phi::CustomContext const&, std::vector<phi::DenseTensor const*, std::allocator<phi::DenseTensor const*> > const&, paddle::experimental::ScalarBase<phi::DenseTensor> const&, phi::DenseTensor*)
10  aclnnCat
11  InitL2Phase2Context(char*, aclOpExecutor*)
12  GetOpExecCacheFromExecutor(aclOpExecutor*)

基础健康检查

python -c "import paddle; paddle.utils.run_check()"
/root/.local/lib/python3.10/site-packages/paddle/utils/cpp_extension/extension_utils.py:686: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
  warnings.warn(warning_message)
I1108 15:49:13.433903 112098 init.cc:236] ENV [CUSTOM_DEVICE_ROOT]=/root/.local/lib/python3.10/site-packages/paddle_custom_device
I1108 15:49:13.433957 112098 init.cc:145] Try loading custom device libs from: [/root/.local/lib/python3.10/site-packages/paddle_custom_device]
I1108 15:49:13.977823 112098 custom_device.cc:1099] Succeed in loading custom runtime in lib: /root/.local/lib/python3.10/site-packages/paddle_custom_device/libpaddle-custom-npu.so
I1108 15:49:13.988801 112098 custom_kernel.cc:63] Succeed in loading 357 custom kernel(s) from loaded lib(s), will be used like native ones.
I1108 15:49:13.989019 112098 init.cc:157] Finished in LoadCustomDevice with libs_path: [/root/.local/lib/python3.10/site-packages/paddle_custom_device]
I1108 15:49:13.989063 112098 init.cc:242] CustomDevice: npu, visible devices count: 1
Running verify PaddlePaddle program ... 
I1108 15:49:14.750527 112098 pir_interpreter.cc:1480] New Executor is Running ...
I1108 15:49:14.753567 112098 pir_interpreter.cc:1506] pir interpreter is running by multi-thread mode ...
PaddlePaddle works well on 1 npu.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

其他补充信息 Additional Supplementary Information

No response

cuicheng01 commented 4 days ago

您好,npu上的ocr建议使用paddlex呢

liyang051 commented 4 days ago

paddlex也试过,同样的错误,请问下版本有什么要求吗?paddlex 用的3.0.0b1

liyang051 commented 3 days ago

测试通过了,paddlex和paddle都使用3.0.0b1版本

lanmao9000 commented 1 day ago

测试通过了,paddlex和paddle都使用3.0.0b1版本

cann是哪个版本?ubuntu20系统么?

感谢~~~~~