nv-tlabs / GSCNN

Gated-Shape CNN for Semantic Segmentation (ICCV 2019)
https://nv-tlabs.github.io/GSCNN/
Other
915 stars 200 forks source link

Training from scratch error #28

Closed kaushikb258 closed 4 years ago

kaushikb258 commented 4 years ago

I tried training on cityscapes from scratch using 'python train.py' and get this error:

raise ValueError('Expected more than 1 value per channel when training, got input size {}'.format(size)) ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])

It is something in the _AtrousSpatialPyramidPoolingModule class in network/gscnn.py

img_features = self.img_conv(img_features)

kaushikb258 commented 4 years ago

Actually got training to work with the following fix in ASPP (replaced AdaptiveAvgPool with AvgPool):

self.img_pooling = nn.AvgPool2d(1) # nn.AdaptiveAvgPool2d(1)

But not sure why training is not working with AdaptiveAvgPool2d

ly-mentaltity commented 4 years ago

your batchsize is not even