-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up and using a Virtual Machine on Google Cloud Platform
We used a VM on GCP to train and run this project. To ensure that you have the same experience, you can set up your own VM to be similar to ours. Setting up a VM is hard if you're doing it for the first time. Google has a sort-of-good documentation here, which gets you a VM with Tensorflow already installed.

From the main menu, under "Compute", choose "Compute Engine" then "VM instances".
Click on "Create Instance" from the top bar, then choose "Marketplace" from the left bar.
Search for and choose "Deep Learning VM". Click "Launch on Compute Engine".
Configure the VM as below, then click "Deploy".
Wait for a minute or two, then you will have your VM ready!
The Cloud SDK (gcloud
) is the preferred command line tool for interfacing with your instance. Download it here.
From the main menu, under "Tools", choose "Deployment Manager" then "Deploy". Note that you can pin this category for quick access.
Click on your VM instance, then under "Suggested next steps" on the right bar, copy the command line to SSH into the VM and forward port 8080 on the VM to port 8080 on your local machine. Modify the command so that it forward port 5000 on the VM to port 5000 on your local machine instead (because we are using a Flask app, which by default runs on port 5000 in development). Run that command line.
Congratulations! Your GCP VM is now ready.
Once you SSH'ed into your GCP VM:
Note: You have to use pip3
! Otherwise flask will complain.
pip3 install -r MagicBrush/app/requirements.txt
Get our training checkpoints from Google Cloud and put them in the directory.
cd MagicBrush/app
mkdir checkpoints
gsutil cp -r gs://transformer-results-bucket/MagicBrush/* checkpoints
FLASK_APP=app.py flask run
You should be able to see MagicBrush at localhost:5000
!