-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define initialize
, run
, finalize
sections in bundle config
#294
Comments
CC @wyli @SachidanandAlle @holgerroth for more discussion. Thanks. |
Fixes #5821 . ### Description The main idea of this PR is to solve 3 pain points of the current bundle training or inference workflow: 1. Training or inference is defined in a "rigid" `training` or `evaluation` list, so 3rd party package can't flexibly initialize and run the workflows separately, see: Project-MONAI/model-zoo#294. This PR splits it into `initialize`, `run` and `finalize`, and still compatible with current existing bundles. 2. 3rd party packages need to access the bundle config directly with specifed keys based on `ConfigParser`, but some developers of bundles don't want to write JSON or YAML configs. This PR implemented the interface to support both config-based and python-based workflows. 3. MONAI Label, MONAI deploy, MONAI-FL require many fixed properties of a training or inference workflow, but we don't have definition for them in the code, just described in the developer guide doc of model-zoo. This PR implemented the `TrainProperties` and `inferenceProperties` interfaces and check tool. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Nic Ma <nma@nvidia.com> Signed-off-by: root <root@apt-sh-ai.nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: root <root@apt-sh-ai.nvidia.com>
Hi @yiheng-wang-nv , As PR Project-MONAI/MONAI#5822 had been merged into MONAI 1.2rc1, could you please help update existing bundles to this Thanks in advance. |
Update: I'm now working on this ticket. According to the latest discussion with @Nic-Ma , we will use |
part of #294 ### Description This PR modifies `spleen_ct_segmentation` with new interface. All scripts and commands in the readme are checked locally. ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [x] In-line docstrings updated. - [x] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [x] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [x] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [x] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [x] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [x] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`).
part of #294 . ### Description This PR is used to fix the typo comes from #331 . ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`).
Part of #294 . ### Description This PR updates several bundles with `BundleWorkflow ` interface, and also fix a few errors. Commands in all bundles are tested with `monai==1.2.0rc3` locally with the changes except the following two: ~~1. `wholeBody_ct_segmentation`~~ (checked) ~~2. `pathology_nuclei_segmentation_classification`~~ (checked) ~~because I do not have these two datasets locally.~~ ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`). --------- Signed-off-by: Yiheng Wang <vennw@nvidia.com> Signed-off-by: tangy5 <yucheng.tang@vanderbilt.edu> Co-authored-by: tangy5 <yucheng.tang@vanderbilt.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This ticket is resolved |
part of Project-MONAI#294 ### Description This PR modifies `spleen_ct_segmentation` with new interface. All scripts and commands in the readme are checked locally. ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [x] In-line docstrings updated. - [x] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [x] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [x] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [x] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [x] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [x] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`).
…MONAI#335) part of Project-MONAI#294 . ### Description This PR is used to fix the typo comes from Project-MONAI#331 . ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`).
Part of Project-MONAI#294 . ### Description This PR updates several bundles with `BundleWorkflow ` interface, and also fix a few errors. Commands in all bundles are tested with `monai==1.2.0rc3` locally with the changes except the following two: ~~1. `wholeBody_ct_segmentation`~~ (checked) ~~2. `pathology_nuclei_segmentation_classification`~~ (checked) ~~because I do not have these two datasets locally.~~ ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`). --------- Signed-off-by: Yiheng Wang <vennw@nvidia.com> Signed-off-by: tangy5 <yucheng.tang@vanderbilt.edu> Co-authored-by: tangy5 <yucheng.tang@vanderbilt.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
Currently, to support code execution in order, we defined expressions in a list of bundle config, like:
https://github.com/Project-MONAI/model-zoo/blob/dev/models/spleen_ct_segmentation/configs/multi_gpu_train.json#L27
But when loading the bundle in other applications, like MONAI Label, MONAI FL, we want to get the
trainer
or other components and hard to execute all the expressions in the list immediately, so we re-define much logic in the python parser, like:https://github.com/Project-MONAI/MONAI/blob/dev/monai/fl/client/monai_algo.py#L460
To easily connect with other apps, I think we should clearly define the expressions in
initialize
,run
,finalize
sections, then others can call the operations separately. For example:Will also create another ticket to define a high level API
Bundle
to simplify the bundle loading in other apps.The text was updated successfully, but these errors were encountered: