Advertisement
Guest User

the error

a guest
Dec 20th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.56 KB | Source Code | 0 0
  1. ---------------------------------------------------------------------------
  2. TypeError                                 Traceback (most recent call last)
  3. /tmp/ipykernel_27/3575863457.py in <module>
  4.       2 decoder = Decoder().to(device)
  5.       3 test_img = torch.unsqueeze(train_data[0], dim=0)
  6. ----> 4 print(encoder(test_img))
  7.  
  8. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
  9.    1108         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
  10.    1109                 or _global_forward_hooks or _global_forward_pre_hooks):
  11. -> 1110             return forward_call(*input, **kwargs)
  12.    1111         # Do not call functions when jit is used
  13.    1112         full_backward_hooks, non_full_backward_hooks = [], []
  14.  
  15. /tmp/ipykernel_27/3812226487.py in forward(self, x)
  16.      33         )
  17.      34     def forward(self, x):
  18. ---> 35         x = self.encoder_cnn(x)
  19.      36         x = self.flat(x)
  20.      37         x = self.encoder_fc(x)
  21.  
  22. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
  23.    1108         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
  24.    1109                 or _global_forward_hooks or _global_forward_pre_hooks):
  25. -> 1110             return forward_call(*input, **kwargs)
  26.    1111         # Do not call functions when jit is used
  27.    1112         full_backward_hooks, non_full_backward_hooks = [], []
  28.  
  29. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/container.py in forward(self, input)
  30.     139     def forward(self, input):
  31.     140         for module in self:
  32. --> 141             input = module(input)
  33.     142         return input
  34.     143
  35.  
  36. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
  37.    1108         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
  38.    1109                 or _global_forward_hooks or _global_forward_pre_hooks):
  39. -> 1110             return forward_call(*input, **kwargs)
  40.    1111         # Do not call functions when jit is used
  41.    1112         full_backward_hooks, non_full_backward_hooks = [], []
  42.  
  43. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/conv.py in forward(self, input)
  44.     445
  45.     446     def forward(self, input: Tensor) -> Tensor:
  46. --> 447         return self._conv_forward(input, self.weight, self.bias)
  47.     448
  48.     449 class Conv3d(_ConvNd):
  49.  
  50. /opt/conda/lib/python3.7/site-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
  51.     442                             _pair(0), self.dilation, self.groups)
  52.     443         return F.conv2d(input, weight, bias, self.stride,
  53. --> 444                         self.padding, self.dilation, self.groups)
  54.     445
  55.     446     def forward(self, input: Tensor) -> Tensor:
  56.  
  57. TypeError: conv2d() received an invalid combination of arguments - got (tuple, Parameter, Parameter, tuple, tuple, tuple, int), but expected one of:
  58.  * (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
  59.       didn't match because some of the arguments have invalid types: (!tuple!, !Parameter!, !Parameter!, !tuple!, !tuple!, !tuple!, int)
  60. * (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)
  61.      didn't match because some of the arguments have invalid types: (!tuple!, !Parameter!, !Parameter!, !tuple!, !tuple!, !tuple!, int)
Tags: error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement