Closed atriun closed 5 months ago
Hi @atriun,
as a first step, I would suggest that you rerun your preprocessing and verify the dataset integrity to make sure that your data is properly configured:
nnUNetv2_plan_and_preprocess -d XXX --verify_dataset_integrity
Also, do you get the same error when training the 3d_fullres configuration?
Best regards
Good morning, I am having some problems trying to run nnunet for 2d configuration, I am getting the error i attached below.
I plotted the sizes of variables gt and y_onehot in the forward function of MemoryEfficientSoftDiceScore(nn.Module) in dice.py, in case it helps. I do not know how to solve it or what the source of the error could be :(
Thank you very much in advance!
2024-04-25 11:31:49.581051: Unable to plot network architecture: 2024-04-25 11:31:49.584883: 'torch._C.Node' object is not subscriptable 2024-04-25 11:31:49.638236: 2024-04-25 11:31:49.638721: Epoch 0 2024-04-25 11:31:49.639375: Current learning rate: 0.01 gt shape is torch.Size([4, 1, 256, 256]) and y_onehot is torch.Size([4, 2, 256, 256]) Traceback (most recent call last): File "/home/miniconda3/envs/envpython38/bin/nnUNetv2_train", line 8, in
sys.exit(run_training_entry())
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/run/run_training.py", line 247, in run_training_entry
run_training(args.dataset_name_or_id, args.configuration, args.fold, args.tr, args.p, args.pretrained_weights,
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/run/run_training.py", line 190, in run_training
nnunet_trainer.run_training()
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py", line 1210, in run_training
train_outputs.append(self.train_step(next(self.dataloader_train)))
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py", line 850, in train_step
l = self.loss(output, target)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, *kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/training/loss/deep_supervision.py", line 30, in forward
l = weights[0] self.loss([j[0] for j in args])
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(args, kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/training/loss/compound_losses.py", line 51, in forward
dc_loss = self.dc(net_output, target_dice, loss_mask=mask) \
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(args, kwargs)
File "/home/miniconda3/envs/envpython38/lib/python3.8/site-packages/nnunetv2/training/loss/dice.py", line 99, in forward
yonehot.scatter(1, gt, 1)
RuntimeError: index 14 is out of bounds for dimension 1 with size 2