PyTorch - JetPack 5.1.1 - Can't import torch

Hello!

I’m trying to use PyTorch on my Orin Nano. I got this wheel torch-1.13.0a0+d0d6b1f2.nv22.10-cp38-cp38-linux_aarch64.whl and installed it with pip.

But now, when I try to import torch in my python script i get the following error:

Traceback (most recent call last):
File “”, line 1, in
File “/home/X/.local/lib/python3.8/site-packages/torch/init.py”, line 661, in
from ._tensor import Tensor
File “/home/X/.local/lib/python3.8/site-packages/torch/_tensor.py”, line 21, in
from torch.overrides import (
File “/home/X/.local/lib/python3.8/site-packages/torch/overrides.py”, line 33, in
from torch._C import (
ImportError: cannot import name ‘_set_torch_function_mode’ from ‘torch._C’ (/home/X/.local/lib/python3.8/site-packages/torch/_C.cpython-38-aarch64-linux-gnu.so)

Does anybody have an idea how to fix this problem?

Pytorch can be a little difficult to setup manually in jetson, I suggest you try docker images for l4t jetson-containers/packages/l4t/l4t-pytorch at master · dusty-nv/jetson-containers · GitHub

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