Torchvision::nms couldn't run

Sakib_H_Chowdhury: <p>I am trying to resolve this issue for almost 12 hrs. Sadly didn’t found that. Please, help me out <img src="https://discuss.pytorch.org/images/emoji/apple/pray.png?v=12" title=":pray:" class="emoji" alt=":pray:" loading="lazy" width="20" height="20">.</p>
<p>Here’s what i did:</p>
<ol>
<li>Installed CUDA 12.4 toolkit and its corresponding pytorch. (Didn’t worked)</li>
<li>Uninstalled pytorch and reinstalled that (didn’t worked)</li>
<li>Uninstalled CUDA 12.4 and installed 12.1 and its corresponding pytorch (Didn’t worked)</li>
<li>Then again reinstalled for that. Didn’t run that code.</li>
</ol>
<p>My desktop specs: Nvidia RTX 3090 with AMD processor</p>
<p>I tested my installation with this result<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/d/4d828abaab437953af8aec177c68400c39b0d856.png" data-download-href="https://discuss.pytorch.org/uploads/default/4d828abaab437953af8aec177c68400c39b0d856" title="1000077184"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/d/4d828abaab437953af8aec177c68400c39b0d856_2_437x500.png" alt="1000077184" data-base62-sha1="b3GrTIvXkajmjksJlaBtgk6YACi" width="437" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/d/4d828abaab437953af8aec177c68400c39b0d856_2_437x500.png, https://discuss.pytorch.org/uploads/default/original/3X/4/d/4d828abaab437953af8aec177c68400c39b0d856.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/4/d/4d828abaab437953af8aec177c68400c39b0d856.png 2x" data-dominant-color="232323"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">1000077184</span><span class="informations">592×677 180 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>(FYI, i tried the similar process for my laptop with 1050ti, it is still working just fine. But at the end of the video object detection my laptop gets blue screen error with Video TDR error)</p>
<p>Error:</p>
<p>“Could not run ‘torchvision::nms’ with arguments from the ‘CUDA’ backend. This could be because the operator doesn’t exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit <a href="https://fburl.com/ptmfixes" class="inline-onebox" rel="noopener nofollow ugc">Internal Login</a> for possible resolutions. ‘torchvision::nms’ is only available for these backends: [CPU, Meta, QuantizedCPU, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].”</p>

ptrblck: <p>You’ve installed the CPU-only <code>torchvision</code> binary, so uninstall it and install the right one with CUDA support.</p>

Sakib_H_Chowdhury: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/3/f3b93e2dc6c850d62e8209087dd9f26a3198b779.png" data-download-href="https://discuss.pytorch.org/uploads/default/f3b93e2dc6c850d62e8209087dd9f26a3198b779" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/3/f3b93e2dc6c850d62e8209087dd9f26a3198b779_2_690x280.png" alt="image" data-base62-sha1="yM4Uc5OHZJ421id0luooL3WsTLr" width="690" height="280" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/3/f3b93e2dc6c850d62e8209087dd9f26a3198b779_2_690x280.png, https://discuss.pytorch.org/uploads/default/optimized/3X/f/3/f3b93e2dc6c850d62e8209087dd9f26a3198b779_2_1035x420.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/f/3/f3b93e2dc6c850d62e8209087dd9f26a3198b779.png 2x" data-dominant-color="F5DAD6"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1076×437 25.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
i downloaded using this code.</p>
<p>how do I find the GPU accelerated one? Please help me. I will be eagerly looking forward to your result.</p>

Sakib_H_Chowdhury: <p><img src="https://discuss.pytorch.org/uploads/default/original/3X/e/f/ef275699db79418ac51683ea7d0dfa1225efc77a.png" alt="image" data-base62-sha1="y7EoDjzWiumw1KeEbB0meSzIfUu" width="255" height="35"><br>
i have just freshly installed CUDA 12.4 removing the earlier one(even from cache). Above image is the version list showing from “pip list”</p>
<p>“import torch<br>
import torchvision<br>
print(torch.<strong>version</strong>)<br>
print(torchvision.<strong>version</strong>)”</p>
<p> → 2.4.0+cu124<br>
0.19.0+cpu</p>
<p>This version is showing from Jupyter Notebook.</p>
<p>Result: Still the same.<br>
i haven’t tried for CUDA 11.8 because it was from 2022. Should I try that one too???</p>
<p>Please, respond. Thanks in advance</p>

mortbal: <p>uninstall torch and torch vision<br>
then after choosing any compatible cuda version from “<a href="https://pytorch.org/get-started/locally/%E2%80%9D" class="inline-onebox" rel="noopener nofollow ugc">Get Started</a><br>
replace the pip3 command with just pip to install it again using pip and NOT pip3.</p>
<p>also there is a &lt;1% chance you may have incorrect path variables in windows you can open cmd and type <code>where pip </code>this should show a path to pip.exe if it shows a path to pip3.exe you need to modify environment variables to point to pip.exe</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/5/f5fe3e066b1a421622079dd100a823b6087f2728.png" data-download-href="https://discuss.pytorch.org/uploads/default/f5fe3e066b1a421622079dd100a823b6087f2728" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/f/5/f5fe3e066b1a421622079dd100a823b6087f2728.png" alt="image" data-base62-sha1="z69GTrT3N8R67t9OxnGJ3lciPva" width="690" height="257" data-dominant-color="F5DDDA"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">969×362 14 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>