# PyTorch and torchvision versions are incompatible

**URL:** <https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225>\
**Category:** Jetson AGX Xavier\
**Tags:** pytorch\
**Created:** [October 19, 2022, 4:37am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225 "2022-10-19T04:37:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heartful-echo](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/heartful-echo/32/211845_2.png) [@Heartful-echo](https://forums.developer.nvidia.com/u/Heartful-echo)\
**Post date:** [October 19, 2022, 4:37am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/1 "2022-10-19T04:37:06Z")

</div>

Hi

I am using the below JETPACK with a JETSON AGX Xavier.  
JetPack 5.0.2 (L4T R35.1.0)

I tried the NVIDIA L4T PyTorch from the NGC catalog, but the 32GB Xavier didn’t have enough disk space! !  
Therefore the container cannot be used.

I installed the whl of PyTorch v1.11.0 by following the forum content below.  
[https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048](https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048)

pytorch can use cuda. So far so good.  
 ![a](https://global.discourse-cdn.com/nvidia/original/3X/b/7/b75dd57aba951903be286b1291edc22db586de1c.png)

I installed pytorch v1.11.0, so torchvision installed 0.12.0, see below.  
[https://github.com/pytorch/vision#installation](https://github.com/pytorch/vision#installation)

I installed torchvision using pip.

However!  
When using YOLOv5 it outputs the error below.

```auto
RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch. __version__ and your torchvision version with torchvision. __version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

```

It’s very troubled.  
help me.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [October 19, 2022, 6:40am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/3 "2022-10-19T06:40:28Z")

</div>

Hi,

Please try our PyTorch1.13.0 nv22.09 with TorchVision 0.15.0.  
Details can be found in the below topic:

> [@TensorRT INT8 calibration python API](https://forums.developer.nvidia.com/t/tensorrt-int8-calibration-python-api/227297/22):
>
> Hello @AastaLLL , I think I have resolved the problem. Today 05/10/2022 Nvidia has uploaded a new version of Torch+CUDA support compatible with Jetpack 5.0.2. So I have installed the last one and I have build Torchvision from source [here](https://github.com/pytorch/vision). After doing that, I have Torch and TorchVision both with CUDA support I think. [image] I tried and ran the val.py scipt from yolov5 and it worked. Now I wil try to run it using a TensorRT engine, I hope there will be no issues. I will keep you updated. T…

Thanks.

---

<div class="post-metadata">

**Author:** ![Heartful-echo](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/heartful-echo/32/211845_2.png) [@Heartful-echo](https://forums.developer.nvidia.com/u/Heartful-echo)\
**Post date:** [October 19, 2022, 6:56am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/4 "2022-10-19T06:56:22Z")

</div>

@AastaLLL

Thanks for your comment.  
Where can I get PyTorch1.13.0 nv22.09 and TorchVision 0.15.0?  
I want PyTorch and TorchVision in whl format.

Thank you

---

<div class="post-metadata">

**Author:** ![Heartful-echo](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/heartful-echo/32/211845_2.png) [@Heartful-echo](https://forums.developer.nvidia.com/u/Heartful-echo)\
**Post date:** [October 19, 2022, 7:27am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/5 "2022-10-19T07:27:18Z")

</div>

I have resolved this issue!!

I’ll record the command I typed for reference.  
I use PyTorch1.11.0 so torchvision specified 0.12.0. This is the rule.

```auto
git clone --recursive --branch v0.12.0 https://github.com/pytorch/vision --depth 1
cd vision
python3 setup.py install --user
pip3 uninstall torch torchvision
sudo pip3 install torch-1.11.0-cp38-cp38-linux_aarch64.whl

```

```auto
pip3 list

```

![b](https://global.discourse-cdn.com/nvidia/original/3X/c/7/c73a3583223847a9ee891c26fea6fb6dcfb237ec.png)

I got YOLOv5 working. It’s working as expected.

 ![work.PNG](https://global.discourse-cdn.com/nvidia/original/3X/c/5/c555fe4048fd4a84ccd30955ed507503c49a9f39.jpeg)

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [October 20, 2022, 4:31am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/6 "2022-10-20T04:31:11Z")

</div>

Thanks for the feedback.  
Good to know it works now.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 9, 2022, 5:18am UTC](https://forums.developer.nvidia.com/t/pytorch-and-torchvision-versions-are-incompatible/231225/8 "2022-11-09T05:18:13Z")

</div>

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