Transfer tensor to CUDA

NazaRik: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/d/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd.png" data-download-href="https://discuss.pytorch.org/uploads/default/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd_2_690x203.png" alt="image" data-base62-sha1="oJ6suXZNhpHfDbtxIxv0HIwbzXv" width="690" height="203" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd_2_690x203.png, https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd_2_1035x304.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/d/ad4d69cf96c2eb0a141f288d27ecfcdb6ff2f8dd_2_1380x406.png 2x" data-dominant-color="222322"><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">1804×532 48.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’ve trained my model with CUDA, than trying to evaluate it and test 1 image. But when I’m trying to transfer img tensor to CUDA, happens nothing. What can it be?</p>
<p>CFG.device = ‘cuda:0’</p>
<p>print (img_tensor.is_cuda)<br>
-False</p>

ptrblck: <p>Was your setup working before using the GPU?<br>
Could you post the output of <code>python -m torch.utis.collect_env</code>?</p>

NazaRik: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/1/51d45b9591620361ae96b38be2ac91c9803219dc.png" data-download-href="https://discuss.pytorch.org/uploads/default/51d45b9591620361ae96b38be2ac91c9803219dc" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/1/51d45b9591620361ae96b38be2ac91c9803219dc_2_541x500.png" alt="image" data-base62-sha1="bFTEgDxluU3BBY0eTV8eXS3MV1a" width="541" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/1/51d45b9591620361ae96b38be2ac91c9803219dc_2_541x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/1/51d45b9591620361ae96b38be2ac91c9803219dc_2_811x750.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/5/1/51d45b9591620361ae96b38be2ac91c9803219dc_2_1082x1000.png 2x" data-dominant-color="121212"><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">1422×1312 61.2 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>
here it is</p>

ptrblck: <p>Did you mix the pip wheels with conda binaries?<br>
If so, either uninstall every torch-related package in your current environment and install a single binary or create a new and empty virtual environment and reinstall PyTorch there.</p>

NazaRik: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/2/c2546497ad55014dbddc0ea607f30195238e6c97.png" data-download-href="https://discuss.pytorch.org/uploads/default/c2546497ad55014dbddc0ea607f30195238e6c97" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/2/c2546497ad55014dbddc0ea607f30195238e6c97_2_546x500.png" alt="image" data-base62-sha1="rJ7rixe1YV3aEBO5TcG7aoi0JnN" width="546" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/2/c2546497ad55014dbddc0ea607f30195238e6c97_2_546x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/c/2/c2546497ad55014dbddc0ea607f30195238e6c97_2_819x750.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/c/2/c2546497ad55014dbddc0ea607f30195238e6c97_2_1092x1000.png 2x" data-dominant-color="121212"><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">1416×1295 60.4 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>
In such way?<br>
Or pytorch-cuda and pytorch-mutex too?</p>