ยง2024-12-04

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

  1. install pytorch
(PYTHON-3.10.15) alexlai@JetsonOrinNano:~/build$ pip install torch numpy

2, test

(PYTHON-3.10.15) alexlai@JetsonOrinNano:~/build$ python3
Python 3.10.15 (main, Dec  1 2024, 15:13:15) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch

/home/alexlai/PYTHON-3.10.15/lib/python3.10/site-p>>> import torch
>>> x = torch.rand(5, 3)
>>> print(x)
tensor([[0.8294, 0.4742, 0.8664],
        [0.4162, 0.5028, 0.7493],
        [0.3341, 0.2302, 0.0169],
        [0.9442, 0.2244, 0.9752],
        [0.8030, 0.7327, 0.4280]])
>>> 

>>> torch.cuda.is_available()
False