First of all, thank you to @mmr for creating the step-by-step guide. I was following this guide previously and it works. However, today, AI Saturdays has created a comprehensive guide on how to setup Google Cloud Platform (GCP) for part 1 version 2 (v2).
For those visiting this topic, I think they should check out the new guide for a more comprehensive experience. The guide is using the Paperspace script with minor tweaks to support GCP. The tweaks are:
- Replaced the message asking Paperspace user to reboot their computer with a new command to reboot GCP instance.
- Modified firewall configuration command:
sudo ufw allow 8888:8898/tcp
-->sudo ufw allow 8888/tcp
- Added
#! /bin/bash
Update 2018-01-04 6:20 AM SGT: I have tested & verified this guide. The Paperspace shell script works perfectly for Google Cloud VM instance with a fresh Ubuntu 16 LTS install. I can connect & access Jupyter Notebook in my browser.
Update 2018-01-04 12:00 PM SGT: Tested with lesson 1 notebook (lesson1.ipynb). Jupyter Notebook kernel keeps dying when I try to train a dogs vs cats model in 3 lines of code that looks like:
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(0.01, 3)
When that happened, you will see a message that sounds like “Kernel Restarting. The kernel appears to have died. It will restart automatically.”. Upon investigation, I found out the cause was due to my GCP instance/server runs out of memory (OOM). I was using n1-standard-2 (1 vCPUs, 3.75 GB memory)
. To resolve this issue, you must stop the VM instance to edit its machine type. I upgraded my VM instance to n1-standard-2 (2 vCPUs, 7.5 GB memory)
and things just work fine for now.