Not able to install Pytorch 2.0 on Google Colab

TNitro: <p>Hey there. I’m new to this. I’m using google colab, I was just ignoring xformers till now, since there is this issue if you try to install xformers:<br>
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.</p>
<p>but I would like to use Pytorch 2.0 so I can get better performance in Stable Diffusion.<br>
Can someone help me install it the same way as this command does, but with pytorch 2.0?</p>
<p>!pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 torchtext==0.14.1 torchdata==0.5.1 --extra-index-url <a href="https://download.pytorch.org/whl/cu116" rel="noopener nofollow ugc">https://download.pytorch.org/whl/cu116</a> -U</p>

marksaroufim: <p>The default version on Colab is now 2.0 with cuda 11.8<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/d/edd826d09142fcad1871f49ca7bb12515fca781d.png" data-download-href="https://discuss.pytorch.org/uploads/default/edd826d09142fcad1871f49ca7bb12515fca781d" title="Screenshot 2023-04-12 at 1.32.50 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/edd826d09142fcad1871f49ca7bb12515fca781d_2_690x358.png" alt="Screenshot 2023-04-12 at 1.32.50 PM" data-base62-sha1="xW4gjLsMUBHpSkMUyRGi5BMVapf" width="690" height="358" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/edd826d09142fcad1871f49ca7bb12515fca781d_2_690x358.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/edd826d09142fcad1871f49ca7bb12515fca781d_2_1035x537.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/edd826d09142fcad1871f49ca7bb12515fca781d_2_1380x716.png 2x" data-dominant-color="FBFAFA"><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">Screenshot 2023-04-12 at 1.32.50 PM</span><span class="informations">2466×1280 124 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><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/0/6097f48feab72778858b80af36546469215b37af.png" data-download-href="https://discuss.pytorch.org/uploads/default/6097f48feab72778858b80af36546469215b37af" title="Screenshot 2023-04-12 at 1.33.46 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/0/6097f48feab72778858b80af36546469215b37af_2_589x500.png" alt="Screenshot 2023-04-12 at 1.33.46 PM" data-base62-sha1="dMvoNm9vnafQPXYVh11WheGkcRF" width="589" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/0/6097f48feab72778858b80af36546469215b37af_2_589x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/0/6097f48feab72778858b80af36546469215b37af_2_883x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/6/0/6097f48feab72778858b80af36546469215b37af.png 2x" data-dominant-color="F4F4F5"><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">Screenshot 2023-04-12 at 1.33.46 PM</span><span class="informations">898×762 28.1 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>So you shouldn’t need to install anything new</p>

TNitro: <p>but like I’ve said, this is the error I’m getting when starting it without that command line<br>
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install<br>
I know its 2.0 that should be on google colab, but it doesn’t want to start, but instead gives that error message and shuts down my colab</p>

artoix: <p>Started to get the same error, and can’t find the solution. Any advice?</p>

ganesh1102: <p>try <code>!pip3 install torch torch vision</code>. Normally, this is enough for me to get it working, haven’t run into any issues doing this.</p>

zainab_Bukhari: <aside class="quote no-group" data-username="ganesh1102" data-post="5" data-topic="177375">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/g/8e7dd6/48.png" class="avatar"> ganesh1102:</div>
<blockquote>
<p><code>!pip3 install torch torch vision</code>.</p>
</blockquote>
</aside>
<p>I’m trying to install Pytorch and Torch Vision but the version is not found, also when I try to install other version from the link it says it is not compatible with torch audio Can someone help me to know which versions of torch, torch vision and mmcv will work for me in this , i’m working on segformer<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/7/470a927cb96c20a97c60883d524c0a7174404422.png" data-download-href="https://discuss.pytorch.org/uploads/default/470a927cb96c20a97c60883d524c0a7174404422" title="error"><img src="https://discuss.pytorch.org/uploads/default/original/3X/4/7/470a927cb96c20a97c60883d524c0a7174404422.png" alt="error" data-base62-sha1="a8syb4WkPyNSnXcUo8gf43KJCNk" width="690" height="112" data-dominant-color="373536"><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">error</span><span class="informations">1203×196 14.1 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>

ptrblck: <p>If you need to install an old release, such as <code>1.5.0</code> you would also need to check which Python version is used in your environment as it might be too new for the older release. The same applies for the CUDA version and the used GPUs.</p>

zainab_Bukhari: <p>i’m using cuda 12.2 which versions will work well</p>

ptrblck: <p>Your locally installed CUDA toolkit won’t be used unless you build PyTorch from source or custom CUDA extensions as the PyTorch binaries ship with their own runtime dependencies.</p>