pycocotools,onnxRuntime_gpu 在jetson(Orin,AGX,Xavier NX,nano,TX1,TX2)边缘端硬件通用安装方法

jetson(Orin,AGX,Xavier NX,nano,TX1,TX2)边缘端硬件pycocotools,onnxRuntime_gpu通用安装方法

1. pycocotools 安装

ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects

1.1 前言

若直接pip install pycocotools ,会出现如上错误信息,所以我们直接源码编译
在这里插入图片描述

1.2 源码编译

前提需要安装好如下三个依赖包,分别安装):

pip install setuptools
pip install cython
pip install matplotlib

然后就可以开始源码编译,按照下面4步进行安装:(首先git 源码,然后进入python推理包中进行build,最后进行install)

git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
 
python setup.py build_ext --inplace
python setup.py build_ext install

2.onnxRuntime_gpu

如果手动pip install onnxruntime_gpu,我们会发现并无匹配的aarch64 安装包,这个时候我们可能会想到源码编译,别急,官方已经为不同jetpack版本编译好了onnxRuntime_gpu,链接:https://elinux.org/Jetson_Zoo#ONNX_Runtime
在这里插入图片描述
选择对应jetpack版本以及python版本,手动下载,然后手动安装即可:

pip install onnxruntime_gpu-xxxxxx-linux_aarch64.whl

如果没有梯子下载会比较慢,这里我提供jetpack5.0 python3.8 的安装包百度云下载地址:
链接: https://pan.baidu.com/s/1bicbfcmKWsBMET1LxEMHtw 提取码: xsyu

若安装出现如下错误代码:
AttributeError: module ‘onnxruntime’ has no attribute ‘InferenceSession’
那是因为你安装了onnxruntime cpu版本,卸载掉cpu版本即可

参考:
[1]https://blog.csdn.net/sinat_19758811/article/details/109446799.
[2]https://blog.csdn.net/HaoZiHuang/article/details/128072379
[3]https://elinux.org/Jetson_Zoo#ONNX_Runtime

猜你喜欢

转载自blog.csdn.net/weixin_44312422/article/details/129666601