Command Line Interface

Command line interface for the two top-level commands the package provides.

wandb-utils

wandb-utils [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options

--version

Show the version and exit.

-e, --entity <entity>

Wandb entity (username or team)

-p, --project <project>

Wandb project

-s, --sweep <sweep>

Wandb sweep (default:None)

all-data

wandb-utils all-data [OPTIONS]

Options

--filters <filters>

Filter used while querying wandb for runs. It uses MongoDB query syntax. See https://docs.wandb.ai/ref/python/public-api/runs and https://github.com/wandb/client/blob/v0.10.31/wandb/apis/public.py#L428 for how the query is used. See https://docs.mongodb.com/manual/reference/operator/query/ to learn about all the query operators in MongoDB query.

best-model

wandb-utils best-model [OPTIONS]

Options

-m, --metric <metric>

Required Name of the metric to sort by. Prepend + or - for maximum or minimum, respectively.

-o, --output-file <output_file>

File to which the run names will be written/appended. If not provided, the name will be printed on the console. (default:None)

-f, --fields <fields>

Fields to keep in the final dataframe.

--skip-writing

Skip writing or printing.

download-run-from-wandb

Download single run from wandb server.

RUN is the unique run id.

wandb-utils download-run-from-wandb [OPTIONS] RUN

Options

-o, --output_dir <output_dir>

Required Directory in which to save the run data. It will be saved in output_dir/runid

--include_filter <include_filter>

Glob string for files to include (can pass multiple). See glob_filter.py for details.

--exclude_filter <exclude_filter>

Glob string for Files to exclude (can pass multiple). See glob_filter.py for details.

--overwrite

Arguments

RUN

Required argument

files

Add new files to an existing run run on wandb or copy files from an existing run to local.

run is the id of an existing. This run should already exist.

If chaining, the run ids can be obtained from the DataFrame of the previoius command. To use chaining, run has to be set to ‘df’ and the DataFrame from the previous command should have a column named ‘run’.

wandb-utils files [OPTIONS] RUN

Options

-f, --files <files>

File globs to include (+) and exclude (-) files split using ‘|’. For example, to include all files with extension .json and important.txt, but ignoring all other .txt files and extra.json, in the ‘serialization_dir’ folder, one can pass –files as ‘+ serialization_dir/.json|serialization_dir/important.txt|- serialization_dir/.txt|- serialization_dir/extra.json’.

Note:

  1. There should be exactly one space space between +/- and the glob. If neither + nor - are given,

    we assume it to be +.

  2. There should be no space around the seperator ‘|’.

-F, --files-from-file <files_from_file>

File containing include and/or exclude globs with one glob per line. The format of the globs remains the same as –files option i.e., ‘[+-] glob’.

--base-path <base_path>

By default the full path of the files is preseved on wandb. For instance, if you save ‘serialization_dir/configs/config.json’, it will save config.json under ‘serialization_dir/configs/’ on wandb. If instead, you wish to save config.json in the root directory of the run on wandb, you can provide –base-path=”serialization_dir/configs” and –files=”serialization_dir/configs/config.json”.

--destination <destination>

Wheter to upload to or download from wandb.

Options

wandb | local

--overwrite

What to do when file/folder already exists.

--action <action>

Whether to move the file, delete it or copy. Default is copy.

Options

move | copy | delete

Arguments

RUN

Required argument

filter-df

Apply a processor using pandas.query, pandas.eval, python eval or python exec.

No more than one of the processors should be provided at a time.

wandb-utils filter-df [OPTIONS]

Options

-f, --fields <fields>

Fields to keep in the final dataframe. If not given, all fields are kept.

-i, --index <index>

Field that is unique and can be used as index.

--query <query>

Query string passed to df.query. See https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.html for details

--pd-eval <pd_eval>

String to pass to pd.evalSee https://pandas.pydata.org/docs/reference/api/pandas.eval.html#pandas.eval for details.

--python-eval <python_eval>

String to passed to python’s eval df = eval(python_eval)

--python-exec <python_exec>

String to pass to python’s exec

from-file

Read the data of runs from a input-file created using any wandb-utils command.

input-file is the path to a .csv file.

wandb-utils from-file [OPTIONS] INPUT_FILE

Options

-f, --fields <fields>

Fields to keep in the final dataframe. If not given, all fields are kept.

-i, --index <index>

Field that is unique and can be used as index.

-d, --delimiter <delimiter>

Column delimiter (default: TAB)

Arguments

INPUT_FILE

Required argument

print

Print the contents of a df and optionally write to a file.

wandb-utils print [OPTIONS]

Options

-o, --output_file <output_file>

If given the output is written to the file.

run-dir

wandb-utils run-dir [OPTIONS] RUN

Options

--check_local
--wandb_dir <wandb_dir>

Arguments

RUN

Required argument