OSVAI/ODConv

How to solve this problem:conv2d() received an invalid combination of arguments

yjqy12138 opened this issue · 1 comments

TypeError: conv2d() received an invalid combination of arguments - got (Tensor, weight=Tensor, bias=NoneType, stride=float, padding=int, dilation=int, groups=int), but expected one of:

  • (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
    didn't match because some of the arguments have invalid types: (Tensor, weight=Tensor, !bias=NoneType!, !stride=float!, !padding=int!, !dilation=int!, groups=int)
  • (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)
    didn't match because some of the arguments have invalid types: (Tensor, weight=Tensor, !bias=NoneType!, !stride=float!, !padding=int!, !dilation=int!, groups=int)

Targeting to :output = F.conv2d(x, weight=self.weight.squeeze(dim=0), bias=None, stride=self.stride, padding=self.padding,
dilation=self.dilation, groups=self.groups)

It seems that the input argument of stride is a float value. You can use int() function to convert the float value to an integer.