You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from monai.networks.nets import Quicknat
import torch
model = Quicknat(
num_classes=1,
num_channels=1,
num_filters=64,
se_block=None
).to("cuda:0")
data = torch.rand((1, 1, 32, 32)).to("cuda:0")
out = model(data)
Error Log
{
"name": "TypeError",
"message": "SequentialWithIdx.forward() missing 1 required positional argument: 'indices'",
"stack": "---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[2], line 14
5 model = Quicknat(
6 num_classes=1,
7 num_channels=1,
(...)
10 se_block=None
11 ).to(\"cuda:0\")
12 data = torch.rand((1, 1, 32, 32)).to(\"cuda:0\")
---> 14 out = model(data)
17 # export
18 # convert_to_onnx(model, dataloader, filename='quicknat.onnx', verify=True, use_ort=True)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)
1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1510 else:
-> 1511 return self._call_impl(*args, **kwargs)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1520, in Module._call_impl(self, *args, **kwargs)
1515 # If we don't have any hooks, we want to skip the rest of the logic in
1516 # this function, and just call forward.
1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1518 or _global_backward_pre_hooks or _global_backward_hooks
1519 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1520 return forward_call(*args, **kwargs)
1522 try:
1523 result = None
File /workspace/MONAI/monai/networks/nets/quicknat.py:438, in Quicknat.forward(self, input)
437 def forward(self, input: torch.Tensor) -> torch.Tensor:
--> 438 input, _ = self.model(input, None)
439 return input
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)
1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1510 else:
-> 1511 return self._call_impl(*args, **kwargs)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1520, in Module._call_impl(self, *args, **kwargs)
1515 # If we don't have any hooks, we want to skip the rest of the logic in
1516 # this function, and just call forward.
1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1518 or _global_backward_pre_hooks or _global_backward_hooks
1519 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1520 return forward_call(*args, **kwargs)
1522 try:
1523 result = None
File /workspace/MONAI/monai/networks/nets/quicknat.py:62, in SequentialWithIdx.forward(self, input, indices)
60 def forward(self, input, indices):
61 for module in self:
---> 62 input, indices = module(input, indices)
63 return input, indices
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)
1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1510 else:
-> 1511 return self._call_impl(*args, **kwargs)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1520, in Module._call_impl(self, *args, **kwargs)
1515 # If we don't have any hooks, we want to skip the rest of the logic in
1516 # this function, and just call forward.
1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1518 or _global_backward_pre_hooks or _global_backward_hooks
1519 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1520 return forward_call(*args, **kwargs)
1522 try:
1523 result = None
File /workspace/MONAI/monai/networks/nets/quicknat.py:46, in SkipConnectionWithIdx.forward(self, input, indices)
45 def forward(self, input, indices):
---> 46 return super().forward(input), indices
File /workspace/MONAI/monai/networks/layers/simplelayers.py:129, in SkipConnection.forward(self, x)
128 def forward(self, x: torch.Tensor) -> torch.Tensor:
--> 129 y = self.submodule(x)
131 if self.mode == \"cat\":
132 return torch.cat([x, y], dim=self.dim)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)
1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1510 else:
-> 1511 return self._call_impl(*args, **kwargs)
File /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1520, in Module._call_impl(self, *args, **kwargs)
1515 # If we don't have any hooks, we want to skip the rest of the logic in
1516 # this function, and just call forward.
1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1518 or _global_backward_pre_hooks or _global_backward_hooks
1519 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1520 return forward_call(*args, **kwargs)
1522 try:
1523 result = None
TypeError: SequentialWithIdx.forward() missing 1 required positional argument: 'indices'"
}
Quicknat is introduced by this PR.
Looks like the unit tests are always not tested since squeeze_and_excitation is not a required dependency.
Describe the bug
Quicknat not work as expected.
To Reproduce
Error Log
Quicknat is introduced by this PR.
Looks like the unit tests are always not tested since
squeeze_and_excitation
is not a required dependency.MONAI/tests/test_quicknat.py
Line 39 in ff43028
The text was updated successfully, but these errors were encountered: