pytorchpython-3.8yolov5nvidia-jetson-nano

Torch error running YOLOv5 on Jetson Nano


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 "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: cannot open shared object file: No such file or directory

Solution

  • 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.