[Python] How to run an ONNX model on raspberry pi 4 model b running a x64 bit OS?

Discussão em 'Python' iniciado por Stack, Março 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have trained a DL model on matlab and exported it as an ONNX file, now I need to run it on a raspberry pi 4 model B with Raspberry Pi OS X64 bit (aarch64) and python 3.11.2, I have followed many guides but there is always a problem or something missing Please any one can help me with steps to install onnx runtime and run the code that loads the onnx model

    I have tried installing it using git clone but it fails due to running an old Cmake version, I couldn't update the cmake Also someone suggested using a virtual environment and it succeeded in installing a new cmake version but also struggles again installing the onnx runtime, any help?

    Below are some examples of errors I get:

    pip install onnxruntime ERROR: No matching distribution found for onnxruntime

    ERROR: Could not find a version that satisfies the requirement onnxruntime==1.15.0 (from versions: none) ERROR: No matching distribution found for onnxruntime==1.15.0

    (venv) omarzpi@raspberrypi:~ $ pip install https://github.com/microsoft/onnxru...nnxruntime-1.15.0-cp39-cp39-linux_aarch64.whl Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple ERROR: onnxruntime-1.15.0-cp39-cp39-linux_aarch64.whl is not a supported wheel on this platform.

    ./build.sh --config Release --build_shared_lib --parallel --minimal_build

    CMake Error at CMakeLists.txt:6 (cmake_minimum_required): CMake 3.28 or higher is required. You are running version 3.25.1

    (venv) omarzpi@raspberrypi:~/onnxruntime/build $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-latomic"

    CMake Warning:

    Ignoring extra path from command line:

    ".."

    CMake Error: The source directory "/home/omarzpi/onnxruntime" does not appear to contain CMakeLists.txt.

    Specify --help for usage, or press the help button on the CMake GUI.

    Continue reading...

Compartilhe esta Página