Pytorch installation on Jetson AGX Orin

Hi,

I’m trying to install pytorch recording this links:

When I do this all, I get this error:

yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'
Traceback (most recent call last):
  File "/home/doruk/doruk/yolov8/yolov8/bin/yolo", line 5, in <module>
    from ultralytics.cfg import entrypoint
  File "/home/doruk/doruk/yolov8/ultralytics/__init__.py", line 5, in <module>
    from ultralytics.data.explorer.explorer import Explorer
  File "/home/doruk/doruk/yolov8/ultralytics/data/__init__.py", line 3, in <module>
    from .base import BaseDataset
  File "/home/doruk/doruk/yolov8/ultralytics/data/base.py", line 17, in <module>
    from ultralytics.data.utils import FORMATS_HELP_MSG, HELP_URL, IMG_FORMATS
  File "/home/doruk/doruk/yolov8/ultralytics/data/utils.py", line 19, in <module>
    from ultralytics.nn.autobackend import check_class_names
  File "/home/doruk/doruk/yolov8/ultralytics/nn/__init__.py", line 3, in <module>
    from .tasks import (
  File "/home/doruk/doruk/yolov8/ultralytics/nn/tasks.py", line 10, in <module>
    from ultralytics.nn.modules import (
  File "/home/doruk/doruk/yolov8/ultralytics/nn/modules/__init__.py", line 65, in <module>
    from .head import OBB, Classify, Detect, Pose, RTDETRDecoder, Segment, WorldDetect
  File "/home/doruk/doruk/yolov8/ultralytics/nn/modules/head.py", line 10, in <module>
    from ultralytics.utils.tal import TORCH_1_10, dist2bbox, dist2rbox, make_anchors
  File "/home/doruk/doruk/yolov8/ultralytics/utils/__init__.py", line 47, in <module>
    TORCHVISION_VERSION = importlib.metadata.version("torchvision")  # faster than importing torchvision
  File "/usr/lib/python3.8/importlib/metadata.py", line 530, in version
    return distribution(distribution_name).version
  File "/usr/lib/python3.8/importlib/metadata.py", line 503, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: torchvision

Hi,

importlib.metadata.PackageNotFoundError: torchvision

TorchVision and PyTorch are different libraries.
Based on the error message, TorchVision is missing in your environment.
Please follow our document above to install it.

Thanks.

doruk@ubuntu:~/doruk/yolov8$ source yolov8/bin/activate
(yolov8) doruk@ubuntu:~/doruk/yolov8$ python
Python 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchvision
>>> import torch
>>> print(torch.__version__)
2.1.0a0+41361538.nv23.06
>>> print('CUDA available: ' + str(torch.cuda.is_available()))
CUDA available: True
>>> exit()
(yolov8) doruk@ubuntu:~/doruk/yolov8$ yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'
Traceback (most recent call last):
  File "/home/doruk/doruk/yolov8/yolov8/bin/yolo", line 5, in <module>
    from ultralytics.cfg import entrypoint
  File "/home/doruk/doruk/yolov8/ultralytics/__init__.py", line 5, in <module>
    from ultralytics.data.explorer.explorer import Explorer
  File "/home/doruk/doruk/yolov8/ultralytics/data/__init__.py", line 3, in <module>
    from .base import BaseDataset
  File "/home/doruk/doruk/yolov8/ultralytics/data/base.py", line 17, in <module>
    from ultralytics.data.utils import FORMATS_HELP_MSG, HELP_URL, IMG_FORMATS
  File "/home/doruk/doruk/yolov8/ultralytics/data/utils.py", line 19, in <module>
    from ultralytics.nn.autobackend import check_class_names
  File "/home/doruk/doruk/yolov8/ultralytics/nn/__init__.py", line 3, in <module>
    from .tasks import (
  File "/home/doruk/doruk/yolov8/ultralytics/nn/tasks.py", line 10, in <module>
    from ultralytics.nn.modules import (
  File "/home/doruk/doruk/yolov8/ultralytics/nn/modules/__init__.py", line 65, in <module>
    from .head import OBB, Classify, Detect, Pose, RTDETRDecoder, Segment, WorldDetect
  File "/home/doruk/doruk/yolov8/ultralytics/nn/modules/head.py", line 10, in <module>
    from ultralytics.utils.tal import TORCH_1_10, dist2bbox, dist2rbox, make_anchors
  File "/home/doruk/doruk/yolov8/ultralytics/utils/__init__.py", line 47, in <module>
    TORCHVISION_VERSION = importlib.metadata.version("torchvision")  # faster than importing torchvision
  File "/usr/lib/python3.8/importlib/metadata.py", line 530, in version
    return distribution(distribution_name).version
  File "/usr/lib/python3.8/importlib/metadata.py", line 503, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: torchvision
(yolov8) doruk@ubuntu:~/doruk/yolov8$ 

Hi,

Could you add --system-site-packages when creating the virtual environment?
Thanks.