-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[MONAI Bundle] Very long errors during config instantiation - Clean up raised errors #7451
Labels
enhancement
New feature or request
Comments
I'm happy to send a PR for this @KumoLiu |
11 tasks
Hi @surajpaib, sure, welcome for the contribution. Thanks. |
7 tasks
KumoLiu
pushed a commit
that referenced
this issue
Mar 26, 2024
Fixes #7451 ### Description Reduces the length of error messages and error messages being propagated twice. This helps debug better when long `ConfigComponent`s are being instantiated. Refer to issue #7451 for more details ### 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`. - [x] 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: Suraj Pai <b.pai@maastrichtuniversity.nl> Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
NikolasSchmitz
pushed a commit
to NikolasSchmitz/MONAI
that referenced
this issue
Mar 27, 2024
…ject-MONAI#7569) Fixes Project-MONAI#7451 ### Description Reduces the length of error messages and error messages being propagated twice. This helps debug better when long `ConfigComponent`s are being instantiated. Refer to issue Project-MONAI#7451 for more details ### 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`. - [x] 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: Suraj Pai <b.pai@maastrichtuniversity.nl> Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Yu0610
pushed a commit
to Yu0610/MONAI
that referenced
this issue
Apr 11, 2024
…ject-MONAI#7569) Fixes Project-MONAI#7451 ### Description Reduces the length of error messages and error messages being propagated twice. This helps debug better when long `ConfigComponent`s are being instantiated. Refer to issue Project-MONAI#7451 for more details ### 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`. - [x] 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: Suraj Pai <b.pai@maastrichtuniversity.nl> Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Signed-off-by: Yu0610 <612410030@alum.ccu.edu.tw>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
When there is an error in the monai bundle config during instantiation, and the config is large, the
RuntimeError
ends up being extremely long.This is counterproductive for debugging and pollutes the terminal with uninformative error messages.
The root cause of this looks to be the
RuntimeError
messages generated here:MONAI/monai/bundle/config_item.py
Line 295 in ff43028
MONAI/monai/utils/module.py
Line 274 in ff43028
To Reproduce
Run any relatively large configuration with a wrongly configured argument, and this will occur.
Attached is an example config and the error log below.
The command run for the bundle to run is
python -m monai.bundle run system --config_file config.yaml
error_log.txt
config.json [YAML renamed to JSON as github doesn't allow uploading YAML]
Describe the solution you'd like
A clear and concise error message would be more informative.
I have the following suggestions:
RuntimeError
raised inConfigComponent
as the instantiate call will already raise it. Remove this basically:MONAI/monai/bundle/config_item.py
Line 295 in ff43028
MONAI/monai/utils/module.py
Line 274 in ff43028
__path
and not the fullkwargs
by default. Maybe this could be moved into debug mode instead?The text was updated successfully, but these errors were encountered: