MIC-DKFZ / nnUNet

Apache License 2.0
5.9k stars 1.76k forks source link

Hi, may I ask if the value of the label has to be continuous?For example, 0,1,2, can't it be 200,210,220? #154

Closed zlf123-marker closed 4 years ago

FabianIsensee commented 4 years ago

yes id needs to be continuous

zlf123-marker commented 4 years ago

Thank you very much

zlf123-marker commented 4 years ago

I am using data from this folder: /home/zlf/liuyuan/nnUNet/nnUNet_preprocessed/Task02_yao/nnUNet ############################################### 2020-02-12 18:31:58.697787: Using dummy2d data augmentation 2020-02-12 18:31:58.698380: Creating new split... Traceback (most recent call last): File "run/run_training.py", line 95, in trainer.initialize(not validation_only) File "/home/zlf/nnUNet/nnunet/training/network_training/nnUNetTrainer.py", line 184, in initialize self.dl_tr, self.dl_val = self.get_basic_generators() File "/home/zlf/nnUNet/nnunet/training/network_training/nnUNetTrainer.py", line 333, in get_basic_generators self.do_split() File "/home/zlf/nnUNet/nnunet/training/network_training/network_trainer.py", line 132, in do_split for i, (train_idx, test_idx) in enumerate(kfold.split(all_keys_sorted)): File "/home/zlf/anaconda3/envs/nn_unet/lib/python3.6/site-packages/sklearn/model_selection/_split.py", line 333, in split .format(self.n_splits, n_samples)) ValueError: Cannot have number of splits n_splits=5 greater than the number of samples: n_samples=2.

zlf123-marker commented 4 years ago

What are the reasons for the following errors in the training times

FabianIsensee commented 4 years ago

you need at least 5 training cases to run nnunet, otherwise it cannot do 5 fold cross validation

zlf123-marker commented 4 years ago

2020-02-12 19:10:22.768655: Using dummy2d data augmentation 2020-02-12 19:10:22.769613: unpacking dataset 2020-02-12 19:10:22.895844: done 2020-02-12 19:10:25.275291: Unable to plot network architecture: 2020-02-12 19:10:25.275366: No module named 'hiddenlayer' 2020-02-12 19:10:25.275557: epoch: 0 gpu 0 Traceback (most recent call last): File "run/run_training.py", line 103, in trainer.run_training() File "/home/zlf/nnUNet/nnunet/training/network_training/nnUNetTrainer.py", line 275, in run_training super(nnUNetTrainer, self).run_training() File "/home/zlf/nnUNet/nnunet/training/network_training/network_trainer.py", line 351, in run_training l = self.run_iteration(self.tr_gen, True) File "/home/zlf/nnUNet/nnunet/training/network_training/network_trainer.py", line 543, in run_iteration l.backward() File "/home/zlf/anaconda3/envs/nn_unet/lib/python3.6/site-packages/torch/tensor.py", line 107, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/zlf/anaconda3/envs/nn_unet/lib/python3.6/site-packages/torch/autograd/init.py", line 93, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: CUDA error: device-side assert triggered

zlf123-marker commented 4 years ago

What are the reasons for the following errors in the training times

FabianIsensee commented 4 years ago

You have values in your labels that do not belong there. Check all of your files in labelsTr with np.unique to find out which one it is. Labels need to be consecutive integers: 0, 1, 2, 3, 4