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)
Change Code In main.py line 76
model = ResNet50()
INTOmodel = ResNet50(resolution=(32, 32))
can solve that problem. Because theself.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)