Skip to content
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

Restrict Auto3DSeg fold input based on datalist #7778

Merged
merged 3 commits into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions monai/apps/auto3dseg/auto_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ def set_num_fold(self, num_fold: int = 5) -> AutoRunner:

if num_fold <= 0:
raise ValueError(f"num_fold is expected to be an integer greater than zero. Now it gets {num_fold}")
if num_fold > self.max_fold + 1:
# Auto3DSeg allows no validation set, so the maximum fold number is max_fold + 1
if num_fold > self.max_fold:
# Auto3DSeg must contain validation set, so the maximum fold number is max_fold.
raise ValueError(
f"num_fold is greater than the maximum fold number {self.max_fold} in {self.datalist_filename}."
)
Expand Down
Loading