BottleneckTransformers icon indicating copy to clipboard operation
BottleneckTransformers copied to clipboard

error!!!!!!!!!!!!!!!!!!!!

Open ami66 opened this issue 4 years ago • 1 comments

when I first step to run the model.py, An error occurred:

The size of tensor a (196) must match the size of tensor b (256) at non-singleton dimension 1

ami66 avatar Feb 23 '21 03:02 ami66

Hi, Thanks for comments ! You need to use same size of resolution parameters.

def ResNet50(num_classes=1000, resolution=(224, 224)):
    return ResNet(Bottleneck, [3, 4, 6, 3], num_classes=num_classes, resolution=resolution)


def main():
    model = ResNet50()
    x = torch.randn([2, 3, 224, 224])
    print(model(x).size())
    print(get_n_params(model))

leaderj1001 avatar Feb 23 '21 09:02 leaderj1001