Torch error running YOLOv5 on Jetson Nano

huangapple go评论118阅读模式
英文:

Torch error running YOLOv5 on Jetson Nano

问题

我正在尝试在Jetson Nano(Ubuntu 20.04和Python 3.8)的GPU上运行YOLOv5。我已经使用以下命令设置了YOLOv5:

git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt

然后,我尝试运行detect.py文件(使用基础权重和测试数据),但我遇到了这个错误:

Traceback (most recent call last):
  File "detect.py", line 37, in <module>
    import torch
  File "/home/jetson/.local/lib/python3.8/site-packages/torch/__init__.py", line 198, in <module>
    _load_global_deps()
  File "/home/jetson/.local/lib/python3.8/site-packages/torch/__init__.py", line 151, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcublas.so.11: 无法打开共享对象文件: 没有那个文件或目录
英文:

I am trying to run YOLOv5 with the Jetson Nano (Ubuntu 20.04 and Python 3.8) gpu. I have setup YOLOv5 with these commands

git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt

I then attempted to run the detect.py file (that uses the base weights and testing data) and I got this error:

Traceback (most recent call last):
  File &quot;detect.py&quot;, line 37, in &lt;module&gt;
    import torch
  File &quot;/home/jetson/.local/lib/python3.8/site-packages/torch/__init__.py&quot;, line 198, in &lt;module&gt;
    _load_global_deps()
  File &quot;/home/jetson/.local/lib/python3.8/site-packages/torch/__init__.py&quot;, line 151, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File &quot;/usr/lib/python3.8/ctypes/__init__.py&quot;, line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcublas.so.11: cannot open shared object file: No such file or directory

答案1

得分: 0

这是由于PyTorch版本与Jetson Nano不兼容引起的。要在Jetson Nano上安装torch,您需要安装Jetson Nano版本的torch。

英文:

This was caused by the Pytorch version not being compatable with the Jetson Nano. To install torch on the Jetson Nano you need to install the Jetson Nano verison of torch.

huangapple
  • 本文由 发表于 2023年3月4日 08:25:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/75632892.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定