facebookresearch / facebookresearch/detectron2

DefaultTrainer with LazyConfigs

Open
#5,176 1 comment 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature

Enable use of LazyConfigs with the existing `Defaultrainer`

## Motivation & Examples

`DefaultTrainer` is quite nice. Straight from the documentation "it includes more standard default behaviors that one might want to opt in, including default configurations for optimizer, learning rate schedule, logging, evaluation, checkpointing etc.". However, it is limited to yacs configs.

If one is using the new lazyconfigs, the advice is to copy paste the code in `lazyconfig_train_net.py` and start hacking at it, which can be a bit daunting. I think it would make things simpler if one could just use `DefaultTrainer` to begin with and then expand as needed. Effectively the same approach one would take with YACS configs.

Suppose that `DefaultTrainer` did not exist. The advice for someone with a YACS config would then be to copy a `tools/train_net.py` (a much more complicated one - the current one effectively calls `DefaultTrainer`) and start from there. Having `DefaulTrainer` simplifies this. Unfortunately, this option does not exist if one is starting with lazyConfig files.

Having had a look at it, I feel that it should be possible (a lot of the code in `DefaultTrainer` is similar to the code in `lazyconfig_train_net.py`). There's a few cases that I'm unsure about but if I know that there is interest by upstream, then I could spend time working on it.

Please let me know if there's interest on extending `DefaultTrainer` to support LazyConfig.

Contributor guide

Open the contributing guide

Research direction

Start by comparing DefaultTrainer with tools/lazyconfig_train_net.py, which the issue identifies as the existing LazyConfig entry point. Determine the API and compatibility decisions needed to let DefaultTrainer consume LazyConfigs while retaining its standard behaviors. Done means LazyConfig users can begin with DefaultTrainer instead of copying lazyconfig_train_net.py.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.