Pytorch + torchvision on Jetson AGX Xavier incompatibility

username: Treborsky_github
cooked: <p>Hi,</p>
<p>I’m using pytorch (latest available for Jetson AGX Xavier and JetPack 5.1: <a href="https://docs.nvidia.com/frameworks/install-pytorch-jetson-platform/index.html" rel="noopener nofollow ugc">https://docs.nvidia.com/frameworks/install-pytorch-jetson-platform/index.html</a>) and torchvision installed via pip (<code>python3 -m pip install torchvision</code>) on Jetson AGX Xavier Developer Kit 32GB platform.</p>
<p>I’m getting an error informing me of incompatibility between these two packages.</p>
<p>According to the torchvision compatibility chart:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/5/2/52e775fe4e73ba16a7db55846bf1da7fa7dc087b.png" alt="image" data-base62-sha1="bPp3qxRwYUQVeKNzN8XrpegQiAr" width="645" height="416"><br>
if I built both the packages from main on github repo on my platform, they should work fine together right?</p>
<p>I’m also concerned that if I do this, the performance won’t be as good as the NVIDIA provided pytorch package.</p>
<p>Any feedback is appreciated.</p>

username: ptrblck
cooked: <p>Yes, you can build PyTorch and <code>torchvision</code> from source and both should be compatible. Could you post the error message you are seeing?</p>

username: Treborsky_github
cooked: <p>Sure, here goes:<br>
<code>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 [GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision ](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.</code></p>
<p>The PyTorch version is 1.14, the latest one for Jetson AGX Xavier. Torchvision versions I tried so far are:</p>
<ul>
<li>0.14.0</li>
<li>0.13.0</li>
</ul>
<p>Haven’t gone so far as to building the libraries from source, because I believe this could have worse performance than the NVIDIA-provided package, but I will try eventually if nothing else works.</p>
<p>I also looked into the custom c++ ops thing and it seems like a possible issue, but then I’m not really doing anything out of the ordinary - I’m using yolov5, so there should be no problems there.</p>
<p>The error is always the same.</p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="Treborsky_github" data-post="4" data-topic="174048">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/treborsky_github/48/57967_2.png" class="avatar"> Treborsky_github:</div>
<blockquote>
<p>because I believe this could have worse performance than the NVIDIA-provided package</p>
</blockquote>
</aside>
<p>This shouldn’t be the case as we are upstreaming improvements if possible.</p>
<aside class="quote no-group" data-username="Treborsky_github" data-post="4" data-topic="174048">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/treborsky_github/48/57967_2.png" class="avatar"> Treborsky_github:</div>
<blockquote>
<p>The PyTorch version is 1.14, the latest one for Jetson AGX Xavier.</p>
</blockquote>
</aside>
<p>I’m a bit confused since you have previously mentioned to build from <code>upstream/master</code>:</p>
<aside class="quote no-group" data-username="Treborsky_github" data-post="1" data-topic="174048">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/treborsky_github/48/57967_2.png" class="avatar"> Treborsky_github:</div>
<blockquote>
<p>if I built both the packages from main on github repo on my platform, they should work fine together right?</p>
</blockquote>
</aside>