1

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!!

bruh
  • 11
  • 3

1 Answers1

3

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).

kHarshit
  • 6,199
  • 7
  • 33
  • 49