Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration error test_integration_workflows_gan #6594

Closed
wyli opened this issue Jun 8, 2023 · 1 comment · Fixed by #6593
Closed

integration error test_integration_workflows_gan #6594

wyli opened this issue Jun 8, 2023 · 1 comment · Fixed by #6593
Labels
bug Something isn't working

Comments

@wyli
Copy link
Contributor

wyli commented Jun 8, 2023

Describe the bug

https://github.com/Project-MONAI/MONAI/actions/runs/5209733342

tests/test_integration_workflows_gan.py
MONAI version: 0+untagged.1.gcc90d74
Numpy version: 1.22.3
Pytorch version: 2.0.1+cu117
MONAI flags: HAS_EXT = True, USE_COMPILED = True, USE_META_DICT = False
MONAI rev id: cc90d74b703a8f5494852577ee931c8c1aee0b1a
MONAI __file__: /__w/MONAI/MONAI/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: 0.4.11
ITK version: 5.3.0
Nibabel version: 5.1.0
scikit-image version: 0.21.0
Pillow version: 9.0.1
Tensorboard version: 2.8.0
gdown version: 4.7.1
TorchVision version: 0.15.2+cu117
tqdm version: 4.64.0
lmdb version: 1.3.0
psutil version: 5.9.0
pandas version: 1.3.5
einops version: 0.6.1
transformers version: 4.21.3
mlflow version: 2.4.0
pynrrd version: 1.0.0

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies

monai.transforms.io.dictionary LoadImaged.__init__:image_only: Current default value of argument `image_only=False` has been deprecated since version 1.1. It will be changed to `image_only=True` in version 1.3.

Loading dataset:   0%|          | 0/20 [00:00<?, ?it/s]
Loading dataset: 100%|██████████| 20/20 [00:00<00:00, 350.91it/s]
Current run is terminating due to exception: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]
2023-06-08 11:43:36,468 - ERROR - Exception: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 1068, in _run_once_on_dataset_as_gen
    self.state.output = self._process_function(self, self.state.batch)
  File "/__w/MONAI/MONAI/monai/engines/trainer.py", line 403, in _iteration
    dloss = engine.d_loss_function(g_output, d_input)
  File "/__w/MONAI/MONAI/tests/test_integration_workflows_gan.py", line 68, in discriminator_loss
    realloss = disc_loss_criterion(disc_net(real_images), real)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/__w/MONAI/MONAI/monai/networks/nets/regressor.py", line 150, in forward
    x = self.net(x)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/__w/MONAI/MONAI/monai/networks/blocks/convolutions.py", line 316, in forward
    res: torch.Tensor = self.residual(x)  # create the additive residual from x
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
  File "/__w/MONAI/MONAI/monai/data/meta_tensor.py", line 276, in __torch_function__
    ret = super().__torch_function__(func, types, args, kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/_tensor.py", line 1295, in __torch_function__
    ret = func(*args, **kwargs)
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]
Engine run is terminating due to exception: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]
2023-06-08 11:43:37,863 - ERROR - Exception: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 959, in _internal_run_as_gen
    epoch_time_taken += yield from self._run_once_on_dataset_as_gen()
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 1087, in _run_once_on_dataset_as_gen
    self._handle_exception(e)
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 636, in _handle_exception
    self._fire_event(Events.EXCEPTION_RAISED, e)
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 425, in _fire_event
    func(*first, *(event_args + others), **kwargs)
  File "/__w/MONAI/MONAI/monai/handlers/stats_handler.py", line 203, in exception_raised
    raise e
  File "/opt/conda/lib/python3.8/site-packages/ignite/engine/engine.py", line 1068, in _run_once_on_dataset_as_gen
    self.state.output = self._process_function(self, self.state.batch)
  File "/__w/MONAI/MONAI/monai/engines/trainer.py", line 403, in _iteration
    dloss = engine.d_loss_function(g_output, d_input)
  File "/__w/MONAI/MONAI/tests/test_integration_workflows_gan.py", line 68, in discriminator_loss
    realloss = disc_loss_criterion(disc_net(real_images), real)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/__w/MONAI/MONAI/monai/networks/nets/regressor.py", line 150, in forward
    x = self.net(x)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/container.py", line 217, in forward
    input = module(input)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/__w/MONAI/MONAI/monai/networks/blocks/convolutions.py", line 316, in forward
    res: torch.Tensor = self.residual(x)  # create the additive residual from x
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
  File "/__w/MONAI/MONAI/monai/data/meta_tensor.py", line 276, in __torch_function__
    ret = super().__torch_function__(func, types, args, kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/_tensor.py", line 1295, in __torch_function__
    ret = func(*args, **kwargs)
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 1, 64, 64, 1]

probably introduced by cc90d74 @drbeh please check

@wyli wyli changed the title integration error integration error test_integration_workflows_gan Jun 8, 2023
@wyli wyli added the bug Something isn't working label Jun 8, 2023
wyli added a commit to wyli/MONAI that referenced this issue Jun 8, 2023
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli
Copy link
Contributor Author

wyli commented Jun 8, 2023

I'm including this fix 983b53f

@wyli wyli mentioned this issue Jun 8, 2023
7 tasks
@wyli wyli closed this as completed in #6593 Jun 8, 2023
wyli added a commit that referenced this issue Jun 8, 2023
part of #6151 
fixes #6556
fixes #6594


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant