See the video below for how it all works using the DVC Extension for VS Code, or keep reading to go deeper.
You can send live experiments to DVC Studio, which will show intermediate
results for metrics and plots in any running experiments. To start sharing live
metrics to DVC Studio,
get your Studio token
and save it in your
dvc config or
DVC_STUDIO_TOKEN environment variable. For example, to set it globally for all
of a user's projects:
$ dvc config --global studio.token ***
While the experiment runs, you will see live updates like this in DVC Studio (and so will anyone else with access to the project):
DVC experiments are tied to your Git repo, but they are ignored by
normal Git operations like
git pull, and
git clone. You can
upload completed experiments using
dvc exp push. This will push not only
metrics and plots, but also the code and DVC-cached files (data and
models) so you can pull an experiment, make it persistent, and reproduce it
from your Git repo. For example, in the simplest case, push experiments to Git
$ dvc exp push origin
From your workspace, you can see pushed experiments if you provide a Git remote
dvc exp list.
$ dvc exp list origin refs/tags/baseline-experiment: cnn-32 cnn-64
To download pushed experiments, use
dvc exp pull (with the Git remote and
$ dvc exp pull origin
This puts all the necessary files and data (from both Git and DVC remotes) in your project.
DVC experiments run outside of the regular Git workflow for faster iteration and to avoid polluting your repository's history, but you can easily bring back the most promising experiments into your regular Git workflow. You can convert any pushed experiment from DVC Studio into a persistent Git branch and create a pull request to merge it into your main repo branch:
Alternatively, from your workspace, to share an individual experiment the same
way you share other Git commits, use
dvc exp branch to create
a Git branch from the experiment and share it like any Git
$ dvc exp branch quare-zips Git branch 'quare-zips-branch' has been created from experiment 'quare-zips'. $ git checkout quare-zips-branch Switched to branch 'quare-zips-branch' $ git push origin quare-zips-branch
If you only need to share code and metadata (like parameters and metrics), then pushing to Git should be enough.
$ dvc push
If you don't want to create a new Git branch and instead want to commit the experiment directly on top of your current Git branch, you can bring experiment results to your workspace.
As you share more experiments, DVC Studio and Git remotes may be become cluttered with experiment references.
You can remove experiments in DVC Studio:
To remove pushed experiments using the command line, use
dvc exp remove -g:
$ dvc exp remove -g origin unwet-jinn Removed experiments: unwet-jinn