ResNeSt
ResNeSt copied to clipboard
how to write a test code. the splat.py has code error?
using ResNeSt-50 as an example ` from resnest.torch import resnest50 net = resnest50(pretrained=True) import torch
a = torch.ones(1,3,512,512)
net.cuda() net.train()
net(a.cuda()) `
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 32, 1, 1])
i found this error in splat.py
in line 65
gap = F.adaptive_avg_pool2d(gap, 1) print(gap.shape) gap = self.fc1(gap) print(gap.shape) if self.use_bn: gap = self.bn1(gap)
after adaptive_avg_pool2d, the shape of tensor is like [n,32,1,1]. And the BN layer can not accept this shape of tensor.
i dont know how to insert code...hahaha
sry. that is my fault. close it. i should not use single sample as input
I pushed an issue just now, is the same problem as yours, I think it is no need to use bn here, cuz bn is somehow channel-wise normalization, thist require more than 1 value per channel.