Run Train

Create a file, eg, my_trainer.py and use examples and modify your configs to run the file.

Example Code

Using Unlearn Canvas dataset

from mu.algorithms.scissorhands.algorithm import ScissorHandsAlgorithm
from mu.algorithms.scissorhands.configs import (
    scissorhands_train_mu,
)

algorithm = ScissorHandsAlgorithm(
    scissorhands_train_mu,
    ckpt_path="models/compvis/style50/compvis.ckpt",
    raw_dataset_dir=(
        "/home/ubuntu/Projects/balaram/packaging/data/quick-canvas-dataset/sample"
    ),
    output_dir="/opt/dlami/nvme/outputs",
    dataset_type = "unlearncanvas",
    template = "style",
    template_name = "Abstractionism",
    use_sample = True # to train on sample dataset
)
algorithm.run()

Running the Training Script in Offline Mode

WANDB_MODE=offline python my_trainer.py

How It Works * Default Values: The script first loads default values from the train config file as in configs section.

  • Parameter Overrides: Any parameters passed directly to the algorithm, overrides these configs.

  • Final Configuration: The script merges the configs and convert them into dictionary to proceed with the training.