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
I am trying to remove the segmentation head and add some more layers before adding segmentation head to my model.
But whenever I pass my encoder output to the decoder I keep getting this Error
My encoder output is a list.
Please let me know what am I missing here.
Error msg:
TypeError Traceback (most recent call last)
[<ipython-input-90-ce779b144a7b>](https://localhost:8080/#) in <cell line: 5>()
3 sample_input = torch.randn(2, 3, 640, 640).to(device, dtype = torch.float32) / 128.0 - 1.0
4 y = model.encoder(sample_input)
----> 5 model.decoder(y)
15 frames
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py](https://localhost:8080/#) in _conv_forward(self, input, weight, bias)
547 self.groups,
548 )
--> 549 return F.conv2d(
550 input, weight, bias, self.stride, self.padding, self.dilation, self.groups
551 )
TypeError: conv2d() received an invalid combination of arguments - got (list, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of:
* (Tensor input, Tensor weight, Tensor bias = None, tuple of ints stride = 1, tuple of ints padding = 0, tuple of ints dilation = 1, int groups = 1)
didn't match because some of the arguments have invalid types: (!list of [Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]!, !Parameter!, !NoneType!, !tuple of (int, int)!, !tuple of (int, int)!, !tuple of (int, int)!, !int!)
* (Tensor input, Tensor weight, Tensor bias = None, tuple of ints stride = 1, str padding = "valid", tuple of ints dilation = 1, int groups = 1)
didn't match because some of the arguments have invalid types: (!list of [Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]!, !Parameter!, !NoneType!, !tuple of (int, int)!, !tuple of (int, int)!, !tuple of (int, int)!, !int!)
This is my code:
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = smp.DeepLabV3Plus(encoder_name='timm-mobilenetv3_large_075', encoder_weights='imagenet').to(device)
sample_input = torch.randn(2, 3, 640, 640).to(device, dtype = torch.float32) / 128.0 - 1.0
y = model.encoder(sample_input)
model.decoder(y)
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to remove the segmentation head and add some more layers before adding segmentation head to my model.
But whenever I pass my encoder output to the decoder I keep getting this Error
My encoder output is a list.
Please let me know what am I missing here.
Error msg:
This is my code:
The text was updated successfully, but these errors were encountered: