-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19e0c50
commit e0c321c
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# Training nnUNetv2 on multiple folds | ||
# | ||
# NOTE: This is a template script, modify it as needed | ||
# | ||
# Authors: Naga Karthik, Jan Valosek | ||
# | ||
|
||
# !!! MODIFY THE FOLLOWING VARIABLES ACCORDING TO YOUR NEEDS !!! | ||
config=2d # e.g. 3d_fullres or 2d | ||
dataset_id=002 # e.g. 301 | ||
dataset_name=Dataset002_TEM # e.g Dataset301_XXX | ||
nnunet_trainer="nnUNetTrainer" | ||
|
||
# Select number of folds here | ||
folds=(0 1 2) | ||
# folds=(0) | ||
|
||
echo "-------------------------------------------------------" | ||
echo "Running preprocessing and verifying dataset integrity" | ||
echo "-------------------------------------------------------" | ||
|
||
nnUNetv2_plan_and_preprocess -d ${dataset_id} --verify_dataset_integrity | ||
|
||
for fold in ${folds[@]}; do | ||
echo "-------------------------------------------" | ||
echo "Training on Fold $fold" | ||
echo "-------------------------------------------" | ||
|
||
# training | ||
CUDA_VISIBLE_DEVICES=2 nnUNetv2_train ${dataset_id} ${config} ${fold} -tr ${nnunet_trainer} | ||
|
||
echo "" | ||
echo "-------------------------------------------" | ||
echo "Training completed, Testing on Fold $fold" | ||
echo "-------------------------------------------" | ||
|
||
# inference | ||
CUDA_VISIBLE_DEVICES=2 nnUNetv2_predict -i ${nnUNet_raw}/${dataset_name}/imagesTs -tr ${nnunet_trainer} -o ${nnUNet_results}/${nnunet_trainer}__nnUNetPlans__${config}/fold_${fold}/test -d ${dataset_id} -f ${fold} -c ${config} | ||
|
||
echo "" | ||
echo "-------------------------------------------" | ||
echo " Inference completed on Fold $fold" | ||
echo "-------------------------------------------" | ||
|
||
done |