Skip to content

Commit d0d1292

Browse files
Restrict Auto3DSeg fold input based on datalist (#7778)
Fixes #7777. ### Description Lower the maximum `num_fold` allowed for user inputs in Auto3DSeg AutoRunner ### 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). - [x] In-line docstrings updated. Signed-off-by: Mingxin Zheng <[email protected]> Co-authored-by: YunLiu <[email protected]>
1 parent 7429e2a commit d0d1292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/apps/auto3dseg/auto_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ def set_num_fold(self, num_fold: int = 5) -> AutoRunner:
499499

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

0 commit comments

Comments
 (0)