michuanhaohao/AlignedReID

about run demo issue

Opened this issue · 4 comments

The line code of "checkpoint = torch.load("./log/market1501/alignedreid/checkpoint_ep300.pth.tar")" in demo file, how can I get this pretrain model?is here anyone help here? thanks .

Traceback (most recent call last):
File "Alignedreid_demo.py", line 48, in
a1 = normalize(pool2d(f1[0], type='max'))
File "Alignedreid_demo.py", line 13, in pool2d
x = torch.nn.functional.max_pool2d(tensor, kernel_size=(sz[2]/8, sz[3]))
File "/usr/local/lib/python3.7/dist-packages/torch/_jit_internal.py", line 422, in fn
return if_false(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 797, in _max_pool2d
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
TypeError: max_pool2d(): argument 'kernel_size' (position 2) must be tuple of ints, not tuple

I met same issue, have u solved?

This has to do with your version of PyTorch being different from the one the author used.
Edit: File "Alignedreid_demo.py", line 13, in pool2d
Replace
x = torch.nn.functional.max_pool2d(tensor, kernel_size=(sz[2]/8, sz[3]))
by
x = torch.nn.functional.max_pool2d(tensor, kernel_size=(int(sz[2]/8), int(sz[3])))