ONNXRuntime的安装需要注意 cuda 和 cudnn 的版本 是否适配
查看 版本是否适配具体详见 官网 1. 使用CPU如果只用CPU进行推理,通过下面这个命令安装。【如果要用GPU推理,不要运行下面这个命令】
pip install onnxruntime2. 使用GPU
安装命令为:
pip install onnxruntime-gpu
注:遇到的问题
(1)Collecting onnxruntime-gpu
Could not find a version that satisfies the requirement onnxruntime-gpu (from versions: )
No matching distribution found for onnxruntime-gpu
解决办法:
切换python版本,设置版本优先级
update-alternatives --list python sudo update-alternatives --config python
再次输入指令安装
pip install onnxruntime-gpu



