pip install NAME
import NAME
# TODO - load input
x = None
# Model checkpoint
checkpoint = NAME.DEFAULT_CHECKPOINT
# GPU index
gpu = 0
y = NAME.run(x, checkpoint=checkpoint, gpu=gpu)
"""
Arguments
x
User input
checkpoint
The model checkpoint
gpu
The GPU index
Returns
y
System output
"""
"""Load from file and process
Arguments
input_file
Input file to process
checkpoint
The model checkpoint
gpu : int
The GPU index
Returns
y
System output
"""
"""Process file and save to disk
Arguments
input_file
Input file to process
output_file
Corresponding file to save processed input
checkpoint
The model checkpoint
gpu
The GPU index
"""
"""Process many files and save to disk
Arguments
input_files
Input files to process
output_files
Corresponding files to save processed input
checkpoint
The model checkpoint
gpu
The GPU index
"""
python -m NAME
[-h]
--input_files INPUT_FILES [INPUT_FILES ...]
--output_files OUTPUT_FILES [OUTPUT_FILES ...]
[--checkpoint CHECKPOINT]
[--gpu GPU]
Arguments:
-h, --help
show this help message and exit
--input_files INPUT_FILES [INPUT_FILES ...]
Input files to process
--output_files OUTPUT_FILES [OUTPUT_FILES ...]
Corresponding files to save processed inputs
--checkpoint CHECKPOINT
The model checkpoint
--gpu GPU
The GPU index
python -m NAME.data.download
Download and uncompress datasets used for training
python -m NAME.data.preprocess
Preprocess datasets
python -m NAME.partition
Partition datasets. Partitions are saved in NAME/assets/partitions
.
python -m NAME.train --config <config> --gpus <gpus>
Trains a model according to a given configuration. Uses a list of GPU indices
as an argument, and uses distributed data parallelism (DDP) if more than one
index is given. For example, --gpus 0 3
will train using DDP on GPUs 0
and 3
.
Run tensorboard --logdir runs/
. If you are running training remotely, you
must create a SSH connection with port forwarding to view Tensorboard.
This can be done with ssh -L 6006:localhost:6006 <user>@<server-ip-address>
.
Then, open localhost:6006
in your browser.
python -m NAME.evaluate \
--config <config> \
--checkpoint <checkpoint> \
--gpu <gpu>
Evaluate a model. <checkpoint>
is the checkpoint file to evaluate and <gpu>
is the GPU index.