Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianIsensee committed Feb 19, 2024
2 parents f569e34 + e0137ed commit f00d6b8
Show file tree
Hide file tree
Showing 14 changed files with 532 additions and 335 deletions.
2 changes: 1 addition & 1 deletion documentation/competitions/AutoPETII.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Add the following to the 'configurations' dict in 'nnUNetPlans.json':
```json
"3d_fullres_resenc": {
"inherits_from": "3d_fullres",
"UNet_class_name": "ResidualEncoderUNet",
"network_arch_class_name": "ResidualEncoderUNet",
"n_conv_per_stage_encoder": [
1,
3,
Expand Down
2 changes: 1 addition & 1 deletion documentation/explanation_plans_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ nnunetv2.preprocessing.resampling
resampling function must be callable(data, current_spacing, new_spacing, **kwargs). It must be located in
nnunetv2.preprocessing.resampling
- `resampling_fn_seg_kwargs`: kwargs for resampling_fn_seg
- `UNet_class_name`: UNet class name, can be used to integrate custom dynamic architectures
- `network_arch_class_name`: UNet class name, can be used to integrate custom dynamic architectures
- `UNet_base_num_features`: The number of starting features for the UNet architecture. Default is 32. Default: Features
are doubled with each downsampling
- `unet_max_num_features`: Maximum number of features (default: capped at 320 for 3D and 512 for 2d). The purpose is to
Expand Down
10 changes: 4 additions & 6 deletions nnunetv2/batch_running/collect_results_custom_Decathlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,19 @@ def summarize(input_file, output_file, folds: Tuple[int, ...], configs: Tuple[st

if __name__ == '__main__':
use_these_trainers = {
'nnUNetTrainer': ('nnUNetPlans',),
'nnUNetTrainerDiceCELoss_noSmooth': ('nnUNetPlans',),
'nnUNetTrainer_DASegOrd0': ('nnUNetPlans',),
'nnUNetTrainer': ('nnUNetPlans', 'nnUNetResEncUNetPlans', 'nnUNetResEncUNet2Plans', 'nnUNetResBottleneckEncUNetPlans', 'nnUNetResUNetPlans', 'nnUNetResUNet2Plans', 'nnUNetResUNet3Plans', 'nnUNetDeeperResBottleneckEncUNetPlans'),
}
all_results_file= join(nnUNet_results, 'customDecResults.csv')
datasets = [2, 3, 4, 17, 20, 24, 27, 38, 55, 64, 82]
datasets = [2, 3, 4, 17, 24, 27, 38, 55, 137, 217, 220, 221, 223] # amos post challenge, kits2023
collect_results(use_these_trainers, datasets, all_results_file)

folds = (0, 1, 2, 3, 4)
configs = ("3d_fullres", "3d_lowres")
configs = ("3d_fullres", )
output_file = join(nnUNet_results, 'customDecResults_summary5fold.csv')
summarize(all_results_file, output_file, folds, configs, datasets, use_these_trainers)

folds = (0, )
configs = ("3d_fullres", "3d_lowres")
configs = ("3d_fullres", )
output_file = join(nnUNet_results, 'customDecResults_summaryfold0.csv')
summarize(all_results_file, output_file, folds, configs, datasets, use_these_trainers)

42 changes: 20 additions & 22 deletions nnunetv2/batch_running/generate_lsf_runs_customDecathlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ def merge(dict1, dict2):
# after the Nature Methods paper we switch our evaluation to a different (more stable/high quality) set of
# datasets for evaluation and future development
configurations_all = {
2: ("3d_fullres", "2d"),
3: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
4: ("2d", "3d_fullres"),
# 2: ("3d_fullres", "2d"),
# 3: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
# 4: ("2d", "3d_fullres"),
17: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
20: ("2d", "3d_fullres"),
24: ("2d", "3d_fullres"),
27: ("2d", "3d_fullres"),
38: ("2d", "3d_fullres"),
55: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
64: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
82: ("2d", "3d_fullres"),
# 83: ("2d", "3d_fullres"),
# 24: ("2d", "3d_fullres"),
# 27: ("2d", "3d_fullres"),
# 38: ("2d", "3d_fullres"),
# 55: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
137: ("2d", "3d_fullres"),
220: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
# 221: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
223: ("2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres"),
}

configurations_3d_fr_only = {
Expand All @@ -52,25 +52,23 @@ def merge(dict1, dict2):
}

num_gpus = 1
exclude_hosts = "-R \"select[hname!='e230-dgx2-2']\" -R \"select[hname!='e230-dgx2-1']\" -R \"select[hname!='e230-dgx1-1']\" -R \"select[hname!='e230-dgxa100-1']\" -R \"select[hname!='e230-dgxa100-2']\" -R \"select[hname!='e230-dgxa100-3']\" -R \"select[hname!='e230-dgxa100-4']\""
resources = "-R \"tensorcore\""
exclude_hosts = "-R \"select[hname!='e230-dgx2-2']\" -R \"select[hname!='e230-dgx2-1']\""
resources = ""
gpu_requirements = f"-gpu num={num_gpus}:j_exclusive=yes:gmem=33G"
queue = "-q gpu-lowprio"
preamble = "-L /bin/bash \"source ~/load_env_cluster4.sh && "
train_command = 'nnUNet_results=/dkfz/cluster/gpu/checkpoints/OE0441/isensee/nnUNet_results_remake_release nnUNetv2_train'
queue = "-q gpu"
preamble = "-L /bin/bash \"source ~/load_env_mamba_slumber.sh && "
train_command = 'nnUNetv2_train'

folds = (0, )
folds = (1, 2, 3, 4)
# use_this = configurations_2d_only
use_this = merge(configurations_3d_fr_only, configurations_3d_lr_only)
use_this = configurations_3d_fr_only
# use_this = merge(use_this, configurations_3d_c_only)

use_these_modules = {
'nnUNetTrainer': ('nnUNetPlans',),
'nnUNetTrainerDiceCELoss_noSmooth': ('nnUNetPlans',),
# 'nnUNetTrainer_DASegOrd0': ('nnUNetPlans',),
'nnUNetTrainer': ('nnUNetPlans', 'nnUNetResEncUNetMPlans', 'nnUNetResEncUNetLPlans', 'nnUNetResEncUNetXLPlans'),
}

additional_arguments = f'--disable_checkpointing -num_gpus {num_gpus}' # ''
additional_arguments = f' -num_gpus {num_gpus}' # ''

output_file = "/home/isensee/deleteme.txt"
with open(output_file, 'w') as f:
Expand Down
Loading

0 comments on commit f00d6b8

Please sign in to comment.