prlz77 / ResNeXt.pytorch

Reproduces ResNet-V3 with pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sizes do not match

ZubairKhan001 opened this issue · comments

~/ResNeXt.pytorch0$ python test.py ~/DATASETS/cifar.python cifar10 --ngpu 1 --load ./snapshots/model.pytorch --test_bs 128
Files already downloaded and verified
Files already downloaded and verified
While copying the parameter named stage_1.stage_1_bottleneck_0.conv_reduce.weight, whose dimensions in the model are torch.Size([32, 64, 1, 1]) and whose dimensions in the checkpoint are torch.Size([512, 64, 1, 1]), ...
Traceback (most recent call last):
File "test.py", line 114, in
test()
File "test.py", line 79, in test
net.load_state_dict(loaded_state_dict)
File "/home/engineer/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 360, in load_state_dict
own_state[name].copy_(param)
RuntimeError: invalid argument 2: sizes do not match at /opt/conda/conda-bld/pytorch_1503970438496/work/torch/lib/THC/generic/THCTensorCopy.c:95

please look into this issue, i am using pytorch 0.2.0. thanks

Please, read the README file carefuly to check whether the problem can be solved with the advice I put there. Namely:

Update: several commits have been pushed after training the models in Mega, so it is recommended to revert to e10c37d

So, pretraining was perfomed with an older version of this code. You can also run the trin script with the new code to get updated pretrained files. I'll do it when I have some time.