Commands Cheatsheet

Overview

The command examples below generally use the placeholder train operation and related sample flags like lr, dropout, etc. Replace these values with your own.

Short-form options are used for Guild commands when available. Refer to command help for long form.

Install Guild

Latest release:

pip install guildai --upgrade

Latest pre-release:

pip install guildai --upgrade --pre

Check Guild after install:

guild check

Run an Operation

Run a script:

guild run train.py

Run an operation defined in a Guild file:

guild run train

Run with flag values:

guild run train lr=0.1 dropout=0.2

Run without prompting:

guild run train -y

Stage an operation without running it:

guild run train --stage

Start a staged run:

guild run --start RUN-ID

Use command indirection (Bash compatible shells only) to start the latest staged run:

guild run --stage `guild select -G`

Restart a run:

guild run --restart RUN-ID

Restart the lastest run using command indirection (Bash compatible shells only):

guild run --restart `guild select`

Start a new run using another run as a prototype:

guild run --proto RUN-ID

Start a new run using the latest as a prototype (Bash compatible shells only):

guild run --proto `guild select`

Run a Batch

Run four trials given two values for two flags:

guild run train lr=[0.01,0.1] dropout=[0.1,0.2]

Run 20 random trials using flag values from a uniform and log-uniform distribution:

guild run train lr=loguniform[1e-5:1e-1] dropout=[0.1:0.9] -m 20

Run 20 random trials but use Bayesan optimization instead of random:

guild run train lr=loguniform[1e-5:1e-1] dropout=[0.1:0.9] -o gp -m 20

Evaluate Runs

Get general run info:

guild runs info

List run files:

guild ls

List source code files:

guild ls --sourcecode

List all run files, including Guild files and source code:

guild ls -a

Compare runs:

guild compare

Compare runs for an operation:

guild compare -o train

Save compare data to a CSV file:

guild compare --csv runs.csv

Print compare data in CSV format:

guild compare --csv -

View runs in TensorBoard:

guild tensorboard

View runs in Guild View:

guild view

Manage Runs

List Runs

List the latest 20 runs:

guild runs

List the latest 40 runs:

guild runs -m

List all runs:

guild runs -a

List runs for an operation:

guild runs -o train

List completed runs for an operation:

guild runs -o train -C

List the latest 20 deleted runs:

guild runs -d

List all deleted runs:

guild runs -da

List terminated and error runs:

guild runs -ET

List runs started within the last hour:

guild runs -S "last hour"

List runs started today:

guild runs -S today

List runs that are older than 30 days:

guild runs -S "before 30 days ago"

Delete Runs

Delete all runs:

guild runs rm

Delete all failed runs (status error):

guild runs rm -E

Delete all staged runs:

guild runs rm -S

Restore Runs

Restore all deleted runs:

guild runs restore

Restore the latest five deleted runs:

guild runs restore :5

Get Help

General Guild help:

guild --help

Help for a command:

guild COMMAND --help

Help for an operation:

guild run OPERATION --help-op

Help for the current project:

guild help

Help for an installed package:

guild help PACKAGE

Debug an Operation

Test source code rules:

guild run train --test-sourcecode

Test output scalar rules on the latest run output:

guild cat --output | guild run train --test-output-scalars -

Test output scalar rules interactively (i.e. type sample output to evaluate and press Enter):

guild run train --test-output-scalars -

Test flag imports:

guild run train --test-flags

Stage a run to examine its file layout:

guild run train --stage --run-dir /tmp/staged-run