How to replicate clean Google Colab environment locally?

Viewed 487

This might be a weird question to ask. Whenever I'm working on a Linux environment locally, there is always some error or another with imports, installations, CUDA drivers, and anything setup-related.

However, in Google Colab, it just works 100% of the time. Is there a way I can replicate the Google Colab environment locally so I can use my own resources? Is there a difference between a local and Colab environment (other than cloud, obviously).

Again - weird, but would be a great help.

1 Answers

There is no official google colaboratory docker image to set it up locally yet.

If you want to keep using pip package manager there is official tensorflow docker image with GPU support.

All you need to to is to install docker on your machine and pull the image:

docker pull tensorflow/tensorflow:latest-gpu-jupyter then run it: docker run -it --rm --gpus all -p 8888:8888 tensorflow/tensorflow:latest-gpu-jupyter and open browser with http://127.0.0.1:8888/?token=...

You will be welcomed with ready to be used tensorflow-gpu notebook.

Other choice is to use anaconda3 or miniconda3 (minimal distribution) installed in you OS. Conda package manager is usually much easier when it comes to hardware-specific libraries. Here is official guide.

Related