[WIP] Add inspect_ckpt CLI command to monai.bundle (fixes #5537)#8830
Draft
Zeesejo wants to merge 8 commits intoProject-MONAI:devfrom
Draft
[WIP] Add inspect_ckpt CLI command to monai.bundle (fixes #5537)#8830Zeesejo wants to merge 8 commits intoProject-MONAI:devfrom
inspect_ckpt CLI command to monai.bundle (fixes #5537)#8830Zeesejo wants to merge 8 commits intoProject-MONAI:devfrom
Conversation
Fixes Project-MONAI#8820 - input_amplitude was incorrectly computed from `target` and target_amplitude from `input`. Corrected to match semantic meaning and standard forward(input, target) convention. Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Fixes Project-MONAI#8822 - The forward() docstring examples used `print(1-SSIMLoss()(x,y))`, but SSIMLoss already computes 1-ssim internally. The `1-` prefix made examples return ssim (not loss), misleading users into training with inverted loss. Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Adds inspect_ckpt function to analImplements the `python -m monai.bundle inspect_ckpt` CLI command requested in issue Project-MONAI#5537. The new `inspect_ckpt` function in `monai/bundle/scripts.py`: - Loads a checkpoint file and displays tensor names, shapes, and dtypes - Optionally computes the file hash (md5 or sha256), useful for creating large_files.yml entries in model-zoo bundles - Follows the same patterns as other bundle CLI commands Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>yze checkpoint files. Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Signed-off-by: Zeeshan Modi <92383127+Zeesejo@users.noreply.github.com>
Contributor
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5537
Description
Adds
python -m monai.bundle inspect_ckptCLI command as requested in #5537.The new function
inspect_ckptinmonai/bundle/scripts.py:.ptcheckpoint file and prints tensor names, shapes, and dtypeslarge_files.ymlfor model-zoo bundlesdownload,verify_metadata, etc.)_log_input_summaryfor consistent CLI loggingFiles changed:
monai/bundle/scripts.py— addedinspect_ckptfunctionmonai/bundle/__init__.py— exportedinspect_ckptmonai/bundle/__main__.py— registeredinspect_ckptin fire CLItests/bundle/test_bundle_inspect_ckpt.py— 6 unit tests covering: key names, shapes, dtypes, md5/sha256 hashing, print_all_varsTypes of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.