Jetpack 5.1.3, install the Pytorch and PyTorch Vision,but cant not run with cuda

Hello,I have a jetson nano (version of jetpack is 5.1.3) and I’m having some problems with the environment:(i am not use conda environment because this reason https://forums.developer.nvidia.com/t/torch-and-torchvision-versions-are-not-compatible/263007/7)
i try to reference this (https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048/1)web to install pytorch and torchvision. i install torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl pytorch and git V0.16.1 PyTorch Vision. when i test import torchvision i get this result.

>>> import torchvision
/home/tom/myenv/bin/torchvision/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(
/home/tom/myenv/bin/torchvision/torchvision/__init__.py:25: UserWarning: You are importing torchvision within its own root folder (/home/tom/myenv/bin/torchvision). This is not expected to work and may give errors. Please exit the torchvision project source and relaunch your python interpreter.
  warnings.warn(message.format(os.getcwd()))

i use python is 3.8.10 this is pip list result`ackage Version


certifi 2024.2.2
charset-normalizer 3.3.2
contourpy 1.1.1
cycler 0.12.1
Cython 0.29.37
filelock 3.14.0
fonttools 4.52.4
fsspec 2024.5.0
idna 3.7
importlib-resources 6.4.0
jinja2 3.1.4
kiwisolver 1.4.5
MarkupSafe 2.1.5
matplotlib 3.7.5
mpmath 1.3.0
networkx 3.1
numpy 1.24.4
opencv-python 4.9.0.80
packaging 24.0
pandas 2.0.3
pillow 10.3.0
pip 20.0.2
pkg-resources 0.0.0
psutil 5.9.8
py-cpuinfo 9.0.0
pyparsing 3.1.2
python-dateutil 2.9.0.post0
pytz 2024.1
PyYAML 6.0.1
requests 2.32.2
scipy 1.10.1
seaborn 0.13.2
setuptools 44.0.0
six 1.16.0
sympy 1.12
thop 0.1.1.post2209072238
torch 2.1.0a0+41361538.nv23.6
torchvision 0.16.0
tqdm 4.66.4
typing-extensions 4.12.0
tzdata 2024.1
ultralytics 8.2.18
urllib3 2.2.1
zipp 3.19.0 i dont know which part cause this problem.i test this environment in yolov8. only can use cpu cant not use gpu but the gpu can be detect. CPU yolo predict model=yolov8n.pt source=‘https://ultralytics.com/images/bus.jpg’ device=cpu
Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt to ‘yolov8n.pt’…
100%|██████████████████████████████████████| 6.23M/6.23M [00:00<00:00, 11.6MB/s]
Ultralytics YOLOv8.2.18 🚀 Python-3.8.10 torch-2.1.0a0+41361538.nv23.06 CPU (ARMv8 Processor rev 1 (v8l))
YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients, 8.7 GFLOPs

Downloading https://ultralytics.com/images/bus.jpg to ‘bus.jpg’…
100%|████████████████████████████████████████| 476k/476k [00:00<00:00, 10.4MB/s]
image 1/1 /home/tom/myenv/bin/bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 1094.2ms
Speed: 38.6ms preprocess, 1094.2ms inference, 990.1ms postprocess per image at shape (1, 3, 640, 480)
Results saved to runs/detect/predict
`
GPU

yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg' device=0
Ultralytics YOLOv8.2.18 🚀 Python-3.8.10 torch-2.1.0a0+41361538.nv23.06 CUDA:0 (Orin, 3425MiB)
Killed

Hi,

... Did you have `libjpeg` or `libpng` installed before building `torchvision` from source? ...

The warning reports some missing packages.
Please try to install it.

But based on your error (killed), the app is running out of memory.
Please confirm it with tegrastats.

$ sudo tegrastats

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.