Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.82k stars 675 forks source link

I use the Spleen 3D segmentation with MONAI tutorials, when using my data input torch.size([1,1,256,256,90]), it appears error. #432

Closed SDTaoPeng closed 2 years ago

SDTaoPeng commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Please only create issues here relating to the functioning of the tutorials. For all other questions/problems/bugs, please refer to MONAI's main repository. For MONAI bugs (not just a problem in the notebook), please create an issue. For questions, please use the Discussions tab.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Install '....'
  3. Run commands '....'

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

SDTaoPeng commented 2 years ago

Backend Qt5Agg is interactive backend. Turning interactive mode on. Traceback (most recent call last): File "C:\Users\S209850\Pycharm\plugins\python-ce\helpers\pydev\pydevd.py", line 1477, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Users\S209850\Pycharm\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Residual_Disease/3D_Pytorch/MONAI_npy_input/main_spleen.py", line 317, in outputs = model(inputs) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, kwargs) File "C:\Users\S209850\Anaconda3\lib\site-packages\monai\networks\nets\unet.py", line 237, in forward x = self.model(x) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, *kwargs) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 139, in forward input = module(input) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(input, kwargs) File "C:\Users\S209850\Anaconda3\lib\site-packages\monai\networks\layers\simplelayers.py", line 126, in forward y = self.submodule(x) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, *kwargs) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 139, in forward input = module(input) File "C:\Users\S209850\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(input, **kwargs) File "C:\Users\S209850\Anaconda3\lib\site-packages\monai\networks\layers\simplelayers.py", line 129, in forward return torch.cat([x, y], dim=self.dim) RuntimeError: Sizes of tensors must match except in dimension 4. Got 24 and 23 (The offending index is 0) python-BaseException

rijobro commented 2 years ago

Hi, as the issue template clearly states, unless the issue is explicitly with the unchanged notebook, could you please post future questions as a Discussion in the main repository. For your particular problem, your image has z=90, which isn't a multiple of 8 (there are four lots of stride=2).