py123d_detection.torch.train

Train a camera-based 3D detector.

py123det-train experiment=nuscenes py123det-train experiment=nuscenes_av2 model=bevformer taxonomy=mixed2_3cls py123det-train experiment=nuscenes trainer=smoke paths.data_root=/data/123d

Every option comes from conf/; see conf/config.yaml for what the groups are.

Functions

build_callbacks(cfg)

build_data(cfg)

Training data concatenated and shuffled, validation data kept one loader per dataset.

build_logger(cfg)

main(cfg)

preemption_checkpoint(run_dir)

The newest checkpoint Lightning wrote when SLURM pre-empted this run, if any.

resume_from(cfg)

The checkpoint to continue from, or None to start fresh.

py123d_detection.torch.train.build_data(cfg)[source]

Training data concatenated and shuffled, validation data kept one loader per dataset.

Keeping validation apart is what makes a mixed run diagnosable: one averaged number over three datasets cannot tell you which of them regressed.

Return type:

Py123DDataModule

py123d_detection.torch.train.build_callbacks(cfg)[source]
Return type:

List[Callback]

py123d_detection.torch.train.build_logger(cfg)[source]
py123d_detection.torch.train.preemption_checkpoint(run_dir)[source]

The newest checkpoint Lightning wrote when SLURM pre-empted this run, if any.

On SIGUSR1 Lightning saves hpc_ckpt_<n>.ckpt into the trainer’s default_root_dir and asks scontrol to requeue the job. That file is written at the moment of pre-emption, which is usually mid-epoch, so it holds strictly more progress than the last.ckpt that ModelCheckpoint wrote at the end of the previous epoch.

Return type:

Path | None

py123d_detection.torch.train.resume_from(cfg)[source]

The checkpoint to continue from, or None to start fresh.

run.resume="last" resolves to this run’s own newest checkpoint if it exists: a requeued job reruns the same command, and the first attempt has no checkpoint to find.

A pre-emption save outranks last.ckpt because it is newer. Lightning would pick it up by itself, but only when fit is given no ckpt_path at all, so naming last.ckpt here would quietly throw away however much of the current epoch had been trained.

Return type:

str | None

py123d_detection.torch.train.main(cfg)[source]
Return type:

None