It has been a while since I wrote my first tutorial about running deep learning experiments on Google’s GPU enabled Jupyter notebook interface- Colab. Since then, my several blogs have walked through running either Keras, TensorFlow or Caffe on Colab with GPU accelerated. One missing framework not pre-installed on Colab is PyTorch. Recently, I am checking out a video to video synthesis model requires running on Linux, plus there are gigabytes of data and pre-trained model to download before I can take the shiny model for a spin. I was wondering, why not give Colab a try by leveraging its awesome downloading speed and freely available GPU? Enjoy the for this tutorial. Colab notebook link Let’s starts by installing CUDA on Colab. Installing CUDA 9.2 Why not other CUDA versions? Here are three reasons. As of 9/7/2018, CUDA 9.2 is the highest version officially supported by Pytorch seen on its website . pytorch.org Some of you might think to install CUDA 9.2 might conflicts with TensorFlow since TF so far only supports up to CUDA 9.0. Relax, think of Colab notebook as a sandbox, even you break it, it can be reset easily with few button clicks, let along TensorFlow works just fine after installing CUDA 9.2 since I tested. If you install CUDA version 9.0, you might come across when compiling native CUDA extensions for Pytorch. Some sophisticated Pytorch projects contain for custom layers/operations which run faster than their Python implementations. The downside is you need to compile them from source for the individual platform. In Colab case, which is running on an Ubuntu Linux machine, g++ compiler is employed to compile the native CUDA extension. But CUDA version 9.0 has a bug working with g++ compiler to compile native CUDA extensions, that’s why we picked CUDA version 9.2 which got the bug fixed. the issue custom c++ CUDA extensions Back to installing, will ask you for the Ubuntu version where you want to run the CUDA. To find out, run this cell below in a Colab notebook. the Nvidia developer site It returns the information you want. VERSION="17.10 (Artful Aardvark)" After that, you will be able to navigate through the target platform selections, make the installer type , then click on the button to copy the link address. “deb(local)” right “Download (1.2 GB)” Back to Colab notebook, paste the link after a command to download the file. A 1.2GB file only takes about 10 seconds to download on Colab which means there is no coffee break -_-. wget !wget https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64 Run the following cell to complete the CUDA installation. If you see those lines at the end of the output, that means the installing was successful. Setting up cuda (9.2.148-1) ...Processing triggers for libc-bin (2.26-0ubuntu2.1) ... Continue with Pytorch. Install PyTorch Very easy, go to , there is a selector for how you want to install Pytorch, in our case, pytorch.org OS: Linux Package Manager: pip Python: , which you can verify by running in a shell. 3.6 python --version CUDA: 9.2 It will let you run this line below, after which, the installation is done! pip3 install torch torchvision Run vid2vid demo Out of the curiosity how well the Pytorch performs with GPU enabled on Colab, let’s try the recently published , a Pytorch implementation of our method for high-resolution photorealistic video-to-video translation. That video demo turns poses to a dancing body looks enticing. Video-to-Video Synthesis demo Besides, the demo also depends on custom built CUDA extensions gives the chance to test out the installed CUDA toolkit. The cell below does all the job from getting the code to running the demo with the pre-trained model. The generated frame goes to directory which you can display one by calling the cell below. results/label2city_1024_g1/test_latest/images That wraps up this tutorial. Conclusion and further thought This short post shows you how to get GPU and CUDA backend running on Colab quickly and freely. Unfortunately, the authors of haven’t got a , which I am anxiously waiting. So far, It only serves as a demo to verify our installing of Pytorch on Colab. Feel free to connect with me on social media where I will keep you posted on my future projects and other practical deep learning applications. Pytorch vid2vid testable edge-face, and pose-dance demo posted yet Here are some of my previous Colab tutorials. ” — My first tutorial on Colab, . “How to run Object Detection and Segmentation on a Video Fast for Free colab notebook direct link ”, — . “Quick guide to run TensorBoard in Google Colab Colab notebook direct link Run caffe-cuda on Colab — . Colab notebook direct link Share on Twitter Share on Facebook Originally published at www.dlology.com .