How to install onnx correctly for nvidia jetson nano

Introduction

This article does not need to compile pybind11 from the source code . I searched the site before and compiled pybind11 from the source code. It is a rumor. Here are two articles named Rumor 1 and Rumor 2 .
First of all, the 1.12.0 version of onnx is incompatible with the protobuf compiler 3.0.0 version installed on ubuntu18.04 on jetson nano . Because Yolov5 needs to be run, so I tried the minimum requirement, which is the 1.9.0 version of onnx , and installed it successfully. In addition, all the pip in this article refers to the pip of python3.6.9. I don’t have the pip of python2 here. If you still have it, please replace pip with pip3.

installation steps

I won’t use sudo to obtain permissions. When installing packages, either use a virtual environment, or -u cut into users permissions to install, or sudo first like me, and then install all directly under root permissions (not recommended).

1. Install protobuf related

apt-get install protobuf-compiler libprotobuf-dev

When onnx is installed, it will search for the existing protobuf compiler, so it must be installed first, otherwise the "onnx protobuf compiler not found" error will be reported.

2. Install pybind11

Running pip install pybind11 directly, does not work, but:

pip install pybind11[global]


That's right, as long as [global] is added after pybind11, the error "onnx could not find pybind11 missing pybind11_DIR" or the lack of "pybind11Config.cmake", "pybind11-config.cmake" will be solved .

3. Install onnx

pip install onnx==1.9.0

Why is it this version? I mentioned it in the introduction, otherwise the error "onnx error no match for operator []" will be reported.

final display

Put a picture of a successful installation, lest someone say that there is nothing to prove.

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43945848/article/details/127224535