Skip to content
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
11 changes: 4 additions & 7 deletions monai/apps/nnunet/nnunetv2_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,16 +596,13 @@ def train_single_model_command(
if self.export_validation_probabilities:
cmd.append("--npz")

store_true_flags = {"c", "val", "use_compressed", "disable_checkpointing"}
for _key, _value in kwargs.items():
if _key in store_true_flags:
prefix = "-" if _key in {"p", "pretrained_weights"} else "--"
if isinstance(_value, bool):
if _value:
cmd.append(f"--{_key}")
elif _key in {"p", "pretrained_weights"}:
if _value:
cmd += [f"-{_key}", str(_value)]
cmd.append(f"{prefix}{_key}")
else:
cmd += [f"--{_key}", str(_value)]
cmd += [f"{prefix}{_key}", str(_value)]

cmd_str: list[str] = [str(c) for c in cmd]

Expand Down
Loading