-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix nnUNet test directory leakage into current working directory #8887
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
Open
aymuos15
wants to merge
8
commits into
Project-MONAI:dev
Choose a base branch
from
aymuos15:fix-8886-nnunet-cwd
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+121
−12
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
65ece58
Address code injection vulnerability
ericspod 789a67b
Using regex to match a valid dataset name
ericspod c3c79ab
Typing fix
ericspod 3111e42
Minor fixes and exceptions added
ericspod 8f285d8
Merge branch 'dev' into advisory-fix-1
ericspod 95f4b63
Update from comments
ericspod 0a7f413
Merge branch 'dev' into advisory-fix-1
ericspod a4e5465
Keep generated nnUNet test paths inside the temp dir (#8886)
aymuos15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
nnUNetv2_train argparse flags store_true --c --val --use_compressed --disable_checkpointing💡 Result:
In nnU-Net v2, the command line utility nnUNetv2_train utilizes several argparse flags to control the training and validation process. These flags are implemented as store_true options, meaning they do not require an associated value and serve as toggles [1][2]. The requested flags perform the following functions: --c (Continue training): This flag instructs the trainer to resume training from the most recent checkpoint. It is essential if a training run was interrupted or if you wish to extend a previously stopped training session [2]. --val (Validation only): This flag sets the trainer to skip the training process and instead run only the final validation on the specified fold [2][3]. This is often used after a training run has completed or to re-run validation without re-training [4][3]. --use_compressed: This flag directs the system to use compressed data during training. By default, nnU-Net may decompress data; enabling this flag prevents decompression. It is noted that reading compressed data is significantly more CPU and potentially RAM intensive, and it should only be used when necessary [2]. --disable_checkpointing: This flag disables the saving of model checkpoints during training. This is useful in scenarios where you are testing a configuration or running quick experiments and do not want to consume disk space with multiple large model checkpoint files [2]. In addition to these, the --npz flag is frequently used alongside these commands. Although not explicitly in your list, it is critical to note that --npz is required if you intend to use nnUNetv2_find_best_configuration later, as it forces the model to save the softmax probabilities from the final validation, which are necessary for ensemble creation and model selection [4][3].
Citations:
Fix argv construction for
store_truekwargs (e.g.,--c,--val) inmonai/apps/nnunet/nnunetv2_runner.py(lines 585-605): thekwargsloop always appendsstr(_value), so documented boolean flags (c,val,use_compressed,disable_checkpointing) become--c True/--val Trueinstead of being emitted as bare flags (the same pattern as the special-case--npz). Update the builder to emit--<flag>only when the value isTrueand omit the flag whenFalse(and similarly only includepretrained_weightswhen it’s a real path, notFalse).🤖 Prompt for AI Agents