pytorch-segmentation icon indicating copy to clipboard operation
pytorch-segmentation copied to clipboard

gcn problem

Open foxet opened this issue 7 years ago • 0 comments


TypeError Traceback (most recent call last) in () 1 if torch.cuda.is_available(): 2 #model = torch.nn.DataParallel(FCN(22)) ----> 3 model=FCN(22) 4 model.cuda()

in init(self, num_classes) 81 self.refine10 = Refine(self.num_classes) 82 ---> 83 self.out0 = self._classifier(2048) 84 self.out1 = self._classifier(1024) 85 self.out2 = self._classifier(512)

in _classifier(self, inplanes) 95 96 nn.Conv2d(inplanes, inplanes, 3, padding=1, bias=False), ---> 97 nn.BatchNorm2d(inplanes/2), 98 nn.ReLU(inplace=True), 99 nn.Dropout(.1),

/home/omnisky/anaconda3/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py in init(self, num_features, eps, momentum, affine) 16 self.momentum = momentum 17 if self.affine: ---> 18 self.weight = Parameter(torch.Tensor(num_features)) 19 self.bias = Parameter(torch.Tensor(num_features)) 20 else:

TypeError: torch.FloatTensor constructor received an invalid combination of arguments - got (float), but expected one of:

  • no arguments
  • (int ...) didn't match because some of the arguments have invalid types: (float)
  • (torch.FloatTensor viewed_tensor) didn't match because some of the arguments have invalid types: (float)
  • (torch.Size size) didn't match because some of the arguments have invalid types: (float)
  • (torch.FloatStorage data) didn't match because some of the arguments have invalid types: (float)
  • (Sequence data) didn't match because some of the arguments have invalid types: (float)

foxet avatar Oct 16 '17 08:10 foxet