vis4d.engine.experiment

Implementation of a single experiment.

Helper functions to execute a single experiment.

This will be called for each experiment configuration.

Functions

ddp_setup([torch_distributed_backend, slurm])

Setup DDP environment and init processes.

run_experiment(config, mode[, num_gpus, ...])

Entry point for running a single experiment.

ddp_setup(torch_distributed_backend='nccl', slurm=False)[source]

Setup DDP environment and init processes.

Parameters:
  • torch_distributed_backend (str) – Backend to use (nccl or gloo)

  • slurm (bool) – If set, setup slurm running jobs.

Return type:

None

run_experiment(config, mode, num_gpus=0, show_config=False, use_slurm=False, ckpt_path=None, resume=False)[source]

Entry point for running a single experiment.

Parameters:
  • config (ExperimentConfig) – Configuration dictionary.

  • mode (str) – Mode to run the experiment in. Either fit or test.

  • num_gpus (int) – Number of GPUs to use.

  • show_config (bool) – If set, prints the configuration.

  • use_slurm (bool) – If set, setup slurm running jobs. This will set the required environment variables for slurm.

  • ckpt_path (str | None) – Path to a checkpoint to load.

  • resume (bool) – If set, resume training from the checkpoint.

Raises:

ValueError – If mode is not fit or test.

Return type:

None