Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade to pytorch-nightly in google colab?

I got into problem , how can i solve this? I want to run pytorch-nightly on colab, I have all codes in pytorch-nightly version because of new packages in it,

I tried to search about this and tried this code but it is not working even after restarting runtime

from os.path import exists
cuda_output = !ldconfig -p|grep cudart.so|sed -e 's/.*\.\([0-9]*\)\.\([0-9]*\)$/cu\1\2/'
accelerator = cuda_output[0] if exists('/dev/nvidia0') else 'cpu'
!pip install torchvision_nightly
!pip install torch_nightly -f https://download.pytorch.org/whl/nightly/{accelerator}/torch_nightly.html

Help!!

like image 452
Li Xiu Ying Avatar asked Sep 01 '25 20:09

Li Xiu Ying


1 Answers

You're using the wrong package name, as mentioned on the pytorch website use this:

!pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html -U

Here, -U option is for upgrade (as there is already pytorch stable version installed on colab).

like image 153
kHarshit Avatar answered Sep 04 '25 05:09

kHarshit