You can store your experiment data in the cloud on Google Cloud Storage or Amazon S3.
This means you store results from multiple training machines in one place and collaborate with other people.
When you list experiments on your local machine, it will list all of the experiments that have run anywhere by anyone, so you can easily compare between them and download the results.
To store data on Google Cloud Storage, you first need to install the Google Cloud SDK if you haven't already. Then, run gcloud init
and follow its instructions:
1
(you want a default region, but it doesn't matter which one).Next, run this, because Cloud SDK needs you to log in a second time to let other applications use your Google Cloud account:
gcloud auth application-default login
Then, create replicate.yaml
with this content, replacing [your model name]
with your model's name, or some other unique string:
repository: "gs://replicate-repository-[your model name]"
First, you need to install and configure the Amazon Web Services CLI if you haven't already. The easiest way to do this on macOS is to install it with Homebrew:
brew install awscli
aws configure
and follow these instructions to configure it. You will need to get an access key ID and secret access key and set the region to us-east-1
(unless you want to use a particular region). You don't need to set an output format, or profile.If you're on another platform, follow these instructions to install the Amazon Web Services CLI.
Then, create replicate.yaml
with this content, replacing [your model name]
with your model's name, or some other unique string:
repository: "s3://replicate-repository-[your model name]"
Now, when you run your training script, calling experiment.checkpoint()
will upload all your working directory and checkpoint metadata to this bucket.
If you're following along from the tutorial, run python train.py
again. This time it will save your experiments to cloud storage. (It takes a second to save each checkpoint, so press Ctrl-C
after a few epochs if you don't want to wait.)
Now, when you run replicate ls
, it will list experiments from the bucket.
If you switch from local file storage to remote cloud storage, you will not see your local experiments any longer. Unlike Git which stores data both locally and remotely, Replicate only stores data in one location.
It is easy to migrate locations, if you ever need to, because Replicate just stores its data as plain files. To migrate from local file storage to the cloud, just copy the .replicate
directory, or wherever you store your data, to your Amazon S3 or Google Cloud Storage bucket.
You can store data in Google Cloud Storage directly from a Colab notebook.
You first need to get your project ID, which is explained in the Google Cloud documentation. Then, run this in a cell in your Colab notebook, replacing the first two variables with your project ID and a name for your Replicate project:
project_id = '[your Cloud Platform project ID]'bucket_name = 'replicate-[your repository name]'from google.colab import authauth.authenticate_user()!gcloud config set project {project_id}!echo 'repository: "gs://{bucket_name}"' > replicate.yaml
For a real example, expand the "Setup" section in this notebook.
You might want to take a look at: