MONAILabel icon indicating copy to clipboard operation
MONAILabel copied to clipboard

Use Multiple Bundle Config Files With Inference/Training

Open ericspod opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. One of the best practice concepts we're documenting with bundles is having a config file with common definitions used by inference or training configs. This would be "common.json" or "common.yaml", and would for example be loaded first before "inference.json" or "train.json". MONAILabel currently loads only one file and optionally will load "multi_gpu_train.json/yaml", if "common.json/yaml" is present would follow best practice to load this file first.

Describe the solution you'd like The bundle infer or train tasks should load "common.json/yaml" before infer/train configs. This should be included in the constants data structures used by these tasks to track what files are searched for. This behaviour should also be clearly documented.

Describe alternatives you've considered Currently definitions have to be duplicated across multiple scripts to ensure compatibility with MONAILabel. This is error-prone and not modular.

Additional context This is an important change I feel in conjunction with the bundle work we're doing for the 1.3 core release.

ericspod avatar Sep 19 '23 11:09 ericspod

CC @SachidanandAlle @diazandr3s Would you have had a chance to take a look at this? Without our updates for bundles I'd like to see what we can do here to keep Label aligned with what I feel is best practice. We could consider an additional tutorial here on creating a bundle from scratch and running it locally with Label.

ericspod avatar Sep 26 '23 17:09 ericspod

Actually I like the BundleWorkflow => InferenceWorkflow || TrainWorkflow

We infact deprecate python based (similar abstraction) which we had introduced in MONAI Label sample-apps and make everything uniform based on the above.

I can see you have defined the entry point for these workflows.. and MONAI Label can directly call those entry points. At any stage if it wants to extend, there is a scope to extend certain methods as well.

I wish, soon we can deprecate whole ConfigWorkflow (in my opinion its a big tech-debt)

Post 0.8 release, we can consider this unification as the next task. It simplifies and avoids any kind of duplication.
Actually more opportunities for anyone to start with MONAI Label and export it as a bundle at the end.. and vice versa..

SachidanandAlle avatar Oct 09 '23 21:10 SachidanandAlle

Do you mean that you would be deprecating the use of bundles which use configuration files? JSON/YAML config files are still going to be the main way bundles are defined so that would limit the scope for Label a lot if so.

ericspod avatar Oct 10 '23 14:10 ericspod