Skip to content

Commit

Permalink
Added new flag to keep prediction not on device
Browse files Browse the repository at this point in the history
  • Loading branch information
ancestor-mithril committed Jun 17, 2024
1 parent 4a92224 commit fb4fd7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nnunetv2/inference/predict_from_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,9 @@ def predict_entry_point():
help="Use this to set the device the inference should run with. Available options are 'cuda' "
"(GPU), 'cpu' (CPU) and 'mps' (Apple M1/M2). Do NOT use this to set which GPU ID! "
"Use CUDA_VISIBLE_DEVICES=X nnUNetv2_predict [...] instead!")
parser.add_argument('--not_on_device', action='store_true', required=False, default=False,
help="Set this flag to not keep the entire case on device. Recommended for large cases that "
"occupy more VRAM than available")
parser.add_argument('--disable_progress_bar', action='store_true', required=False, default=False,
help='Set this flag to disable progress bar. Recommended for HPC environments (non interactive '
'jobs)')
Expand Down Expand Up @@ -922,7 +925,7 @@ def predict_entry_point():
predictor = nnUNetPredictor(tile_step_size=args.step_size,
use_gaussian=True,
use_mirroring=not args.disable_tta,
perform_everything_on_device=True,
perform_everything_on_device=not args.not_on_device,
device=device,
verbose=args.verbose,
verbose_preprocessing=args.verbose,
Expand Down

0 comments on commit fb4fd7c

Please sign in to comment.