leaderj1001 / BottleneckTransformers

Bottleneck Transformers for Visual Recognition
MIT License
274 stars 50 forks source link

An error will occur if use the Cifa10 #11

Open HDUSiberain opened 3 years ago

HDUSiberain commented 3 years ago

Change Code In main.py line 76 model = ResNet50() INTO model = ResNet50(resolution=(32, 32)) can solve that problem. Because the self.rel_h = nn.Parameter(torch.randn([1, heads, n_dims // heads, 1, height]), requires_grad=True) self.rel_w = nn.Parameter(torch.randn([1, heads, n_dims // heads, width, 1]), requires_grad=True) in model.py line 25, 26 width and height number is calculated by resolution init width and height = 14 was calculated in resolution=(224, 224)