Getting Started with PyTorch in Google Colab
Google Colab
Notebooks run by connecting to virtual machines (VM) that have maximum lifetimes that can be as much as 12 hours. Maximum VM lifetime and idle timeout behavior may vary over time, or based on your usage. In Colab
-
Connect
Coonect to hosted runtime
vsConnect to local runtime
-
None
vsGPU
orTPU
Edit
,Notebook settings
,Hardware accelerator
-
!
command, e.g.,!nvidia-smi
-
%
command, e.g.,%matplotlib inline
Install PyTorch and Torchvision
In Colab
!pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
!pip install torchvision
Use Data From Google Drive
Copy the required data file into Google Drive account. In Colab
from google.colab import drive
drive.mount('/content/drive/')