Amshaker / unetr_plus_plus

[IEEE TMI-2024] UNETR++: Delving into Efficient and Accurate 3D Medical Image Segmentation
Apache License 2.0
340 stars 32 forks source link

Error to train acdc dataset #69

Open gumiao1129 opened 7 months ago

gumiao1129 commented 7 months ago

Hello, When I run ./run_training_acdc.sh, it gives the errors below. Could you check and help which I missed. thank you. $ ./run_training_acdc.sh ############################################### I am running the following nnFormer: 3d_fullres My trainer class is: <class 'unetr_pp.training.network_training.unetr_pp_trainer_acdc.unetr_pp_tra For that I will be using the following configuration: num_classes: 3 modalities: {0: 'MRI'} use_mask_for_norm OrderedDict([(0, False)]) keep_only_largest_region None min_region_size_per_class None min_size_per_class None normalization_schemes OrderedDict([(0, 'nonCT')]) stages...

stage: 0 {'batch_size': 4, 'num_pool_per_axis': [2, 5, 5], 'patch_size': array([ 16, 160, 160]), 'median_pat 208], dtype=int64), 'current_spacing': array([5. , 1.5625, 1.5625]), 'original_spacing': array([data_aug': True, 'pool_op_kernel_sizes': [[1, 2, 2], [2, 2, 2], [2, 2, 2], [1, 2, 2], [1, 2, 2]], ' 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]} I am using stage 0 from these plans I am using sample dice + CE loss

I am using data from this folder: ../DATASET_Acdc/unetr_pp_raw/unetr_pp_raw_data/Task01_ACDC\Task0plans_v2.1 ############################################### Traceback (most recent call last): File "../unetr_pp/run/run_training.py", line 171, in main() File "../unetr_pp/run/run_training.py", line 142, in main trainer.initialize(not validation_only) File "C:\Users\miaogu\Desktop\projects\try\unetr_plus_plus\unetr_pp\training\network_training\une", line 98, in initialize self.setup_DA_params() File "C:\Users\miaogu\Desktop\projects\try\unetr_plus_plus\unetr_pp\training\network_training\une", line 450, in setup_DA_params self.print_to_log_file("Using dummy2d data augmentation") File "C:\Users\miaogu\Desktop\projects\try\unetr_plus_plus\unetr_pp\training\network_training\net, line 262, in print_to_log_file with open(self.log_file, 'w') as f: FileNotFoundError: [Errno 2] No such file or directory: '../output_acdc\unetr_pp\3d_fullres\Taskainer_acdc__unetr_pp_Plansv2.1\fold_0\training_log_2024_2_3_21_45_23.txt'

Amshaker commented 4 months ago

Hi,

Thanks for your interest in our work!

Please make sure to run the training from the provided training script in the repo "run_training_acdc.sh"

You can't just run the Python file because there are the following variables you must set before running the training script:

DATASET_PATH=../DATASET_Acdc

export PYTHONPATH=.././
export RESULTS_FOLDER=../output_acdc
export unetr_pp_preprocessed="$DATASET_PATH"/unetr_pp_raw/unetr_pp_raw_data/Task01_ACDC
export unetr_pp_raw_data_base="$DATASET_PATH"/unetr_pp_raw

python ../unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_acdc 1 0
abctaotaodh commented 3 months ago

Hello, when I run run_training_acdc.sh, I gave some mistakes, can you help me check them and correct them? Thanks.

############################################### I am running the following nnFormer: 3d_fullres My trainer class is: <class 'unetr_pp.training.network_training.unetr_pp_trainer_acdc.unetr_pp_trainer_acdc'> For that I will be using the following configuration: num_classes: 3 modalities: {0: 'MRI'} use_mask_for_norm OrderedDict([(0, False)]) keep_only_largest_region None min_region_size_per_class None min_size_per_class None normalization_schemes OrderedDict([(0, 'nonCT')]) stages...

stage: 0 {'batch_size': 4, 'num_pool_per_axis': [2, 5, 5], 'patch_size': array([ 16, 160, 160]), 'median_patient_size_in_voxels': array([ 18, 237, 208]), 'current_spacing': array([5. , 1.5625, 1.5625]), 'original_spacing': array([5. , 1.5625, 1.5625]), 'do_dummy_2D_data_aug': True, 'pool_op_kernel_sizes': [[1, 2, 2], [2, 2, 2], [2, 2, 2], [1, 2, 2], [1, 2, 2]], 'conv_kernel_sizes': [[1, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]}

I am using stage 0 from these plans I am using sample dice + CE loss

I am using data from this folder: ../DATASET_Acdc/unetr_pp_raw/unetr_pp_raw_data/Task01_ACDC/Task001_ACDC/nnFormerData_plans_v2.1 ############################################### 2024-05-20 21:07:36.387509: Using dummy2d data augmentation [0.57142857 0.28571429 0.14285714] loading dataset loading all case properties Traceback (most recent call last): File "../unetr_pp/run/run_training.py", line 171, in main() File "../unetr_pp/run/run_training.py", line 142, in main trainer.initialize(not validation_only) File "/home/lmf/project/unetr_plus_plus-main/unetr_pp/training/network_training/unetr_pp_trainer_acdc.py", line 123, in initialize self.dl_tr, self.dl_val = self.get_basic_generators() File "/home/lmf/project/unetr_plus_plus-main/unetr_pp/training/network_training/Trainer_acdc.py", line 400, in get_basic_generators self.load_dataset() File "/home/lmf/project/unetr_plus_plus-main/unetr_pp/training/network_training/Trainer_acdc.py", line 397, in load_dataset self.dataset = load_dataset(self.folder_with_preprocessed_data) File "/home/lmf/project/unetr_plus_plus-main/unetr_pp/training/dataloading/dataset_loading.py", line 108, in load_dataset dataset[i]['properties'] = load_pickle(dataset[i]['properties_file']) File "/home/lmf/anaconda3/env/anaconda/envs/unetr_pp/lib/python3.8/site-packages/batchgenerators/utilities/file_and_folder_operations.py", line 50, in load_pickle a = pickle.load(f) EOFError: Ran out of input image

My run_training_acdc.sh as follow:

!/bin/sh

DATASET_PATH=../DATASET_Acdc

export PYTHONPATH=.././ export RESULTS_FOLDER=../output_acdc export unetr_pp_preprocessed="$DATASET_PATH"/unetr_pp_raw/unetr_pp_raw_data/Task01_ACDC export unetr_pp_raw_data_base="$DATASET_PATH"/unetr_pp_raw

python ../unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_acdc 1 0