admin管理员组

文章数量:1590367

目录

1 下载onnx

2 编译

3 后来编译onnxruntime v1.10.1时候遇到的错误

4 编译onnxruntime v1.8.0


1 下载onnx

git clone  https://github/microsoft/onnxruntime
cd onnxruntime
git submodule update --init --recursive

2 编译

由于是交叉编译,所以需要设置一下编译工具,在网上搜索看到了这个

chineseocr_lite/build-onnxruntime-android.sh at onnx · DayBreak-u/chineseocr_lite · GitHub

于是 我用下面的命令进行编译 

./build.sh --skip_tests --config Release --build_shared_lib --cmake_extra_defines CMAKE_C_COMPILER=arm-ca9-linux-gnueabihf-gcc CMAKE_CXX_COMPILER=arm-ca9-linux-gnueabihf-g++  --parallel 10

这里就不用写-DCMAKE_C_COMPILER=arm-ca9-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-ca9-linux-gnueabihf-g++了,直接写CMAKE_C_COMPILER=arm-ca9-linux-gnueabihf-gcc CMAKE_CXX_COMPILER=arm-ca9-linux-gnueabihf-g++即可。

然后编译提示下面的错误,

我某搜索引擎搜了一下这个报错

/bin/sh: 1: ../protobuf/cmake/protoc-3.11.3.0: Exec format error

得到如下答案,

 然后点击链接去了https://github/ucb-bar/onnxruntime-riscv/issues/7

可以看到

然后继续去链接 onnxrun

本文标签: 源码版本UbuntuonnxruntimeCPU