Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启paddlelite支持在aarch64架构上编译不成功 #2556

Open
Strepsiades opened this issue Nov 16, 2024 · 0 comments
Open

开启paddlelite支持在aarch64架构上编译不成功 #2556

Strepsiades opened this issue Nov 16, 2024 · 0 comments
Assignees

Comments

@Strepsiades
Copy link

Strepsiades commented Nov 16, 2024

环境

aarch64架构cpu 鲲鹏920 麒麟linux

问题说明:

想要编译一个在aarch64架构的上支持ppocr系列模型的fastdeploy-python。按文档,需要开启paddlelite支持。

按如下命令编译:
'''
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy/python
export ENABLE_ORT_BACKEND=ON
export ENABLE_LITE_BACKEND=ON
export ENABLE_PADDLE_BACKEND=OFF
export ENABLE_OPENVINO_BACKEND=OFF
export ENABLE_VISION=ON
export ENABLE_TEXT=ON

python setup.py build
python setup.py bdist_wheel
'''
发现编译不通过。

初步排查有如下问题:

  1. 链接paddlelite的so文件失败。看了下代码,在编译时,会下载lite-linux-arm64-20221209.tgz,然后其中lite-linux-arm64-20221209\lib里包含一个._libpaddle_full_api_shared.so文件,这个文件是苹果电脑的索引文件,会导致构建脚本误以为它是共享库:
    ’‘’
    AssertionError: patchelf /data/ai/fastdeploy/FastDeploy/python/.setuptools-cmake-build/third_libs/install/paddlelite/lib/._lib
    paddle_full_api_shared.so failed, the command: /data/ai/fastdeploy/FastDeploy/python/.setuptools-cmake-build/third_libs/patchelf/bin/patchelf --set-rpath '$ORIGIN:$ORIGIN/mklml/lib/' /data/ai/fastdeploy/FastDeploy/python/.setuptools-cmake-build/third_l
    ibs/install/paddlelite/lib/._libpaddle_full_api_shared.so
    ‘’‘
    这个问题是1.02引入的,之前是lite-linux-arm64-20220920.tgz

  2. 我把paddlelite的.so文件替换掉,可以编译成功(1.07版本),但是现在运行程序时报:
    '''
    2024-11-14 17:26:17,794 - uvicorn.error - ERROR - Traceback (most recent call last):
    File "/root/miniconda3/envs/fastdeploy/lib/python3.10/site-packages/fastdeploy/c_lib_wrap.py", line 164, in
    from .libs.fastdeploy_main import *
    ImportError: /root/miniconda3/envs/fastdeploy/lib/python3.10/site-packages/fastdeploy/libs/libfastdeploy.so.1.0.7: undefined s
    ymbol: ZN6paddle8lite_api6Tensor11CopyFromCpuIlLNS0_10TargetTypeE1EEEvPKT
    '''

  3. 由于还是未能成功运行。尝试用1.02版本使用lite后端运行ppocrv4,推理过程仍有错误。这部分错误没保存下来。

  4. 最后发现文档里写的,ppocr在aarch64架构linux只支持paddlelite是不对的,实际上支持onnx_runtime,我直接用1.02版本开启onnx_runtime后端就成功运行了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants