Error with Pytorch and Torchvision

I have following error:

(effLO310) modellauto@ubuntu:~/joao-jantalia/Masterarbeit/pytorch/EfficientLO-Net$ python -c “import torchvision; print(torchvision.version)”
Traceback (most recent call last):
File “”, line 1, in
File “/home/modellauto/anaconda3/envs/effLO310/lib/python3.10/site-packages/torchvision/init.py”, line 10, in
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils # usort:skip
File “/home/modellauto/anaconda3/envs/effLO310/lib/python3.10/site-packages/torchvision/_meta_registrations.py”, line 26, in
def meta_roi_align(input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio, aligned):
File “/home/modellauto/anaconda3/envs/effLO310/lib/python3.10/site-packages/torchvision/_meta_registrations.py”, line 19, in wrapper
get_meta_lib().impl(getattr(getattr(torch.ops.torchvision, op_name), overload_name), fn)
File “/home/modellauto/.local/lib/python3.10/site-packages/torch/library.py”, line 288, in impl
raise RuntimeError(
RuntimeError: We should not register a meta kernel directly to the operator ‘torchvision::roi_align’, because it has a CompositeImplicitAutograd kernel in core. Instead we should let the operator decompose, and ensure that we have meta kernels for the base ops that it decomposes into.

Also the following versions of pytorch and torchvision:
torch 2.5.0a0+872d972e41.nv24.8
torchvision 0.20.0

Jetpack and cuda versions:
CUDA 12.6 and Jetpack nvidia-l4t-core 36.4.0-20240912212859

i got my versions from here: jp6/cu126 index

The pytorch and torchvision should be compatible or not? what did i do wrong here?

Hi,
Consider installing virtualenv instead of Anaconda, as support for Anaconda may not be guaranteed.

  1. Set up the Virtual Environment
sudo apt-get install virtualenv
python3 -m virtualenv -p python3 <chosen_venv_name>
source <chosen_venv_name>/bin/activate
  1. Install torch-2.5.0 torchvision-0.20.0
wget http://jetson.webredirect.org/jp6/cu126/+f/5cf/9ed17e35cb752/torch-2.5.0-cp310-cp310-linux_aarch64.whl#sha256=5cf9ed17e35cb7523812aeda9e7d6353c437048c5a6df1dc6617650333049092
pip install torch-2.5.0-cp310-cp310-linux_aarch64.whl
wget http://jetson.webredirect.org/jp6/cu126/+f/5f9/67f920de3953f/torchvision-0.20.0-cp310-cp310-linux_aarch64.whl#sha256=5f967f920de3953f2a39d95154b1feffd5ccc06b4589e51540dc070021a9adb9
pip install torchvision-0.20.0-cp310-cp310-linux_aarch64.whl 

Thanks

2 Likes

Thank you!

1 Like