flychen321 / data_aug_reid

1 stars 0 forks source link

AttributeError: 'collections.OrderedDict' object has no attribute 'state_dict' #2

Open ssbilakeri opened 3 years ago

ssbilakeri commented 3 years ago

while training the model getting bellow error. please suggest

opt = Namespace(batchsize=48, gpu_ids='0', name='data_aug', test_dir='market', use_dense=True, which_epoch='29') opt.gpu_ids = 0 opt.which_epoch = 29 opt.test_dir = market opt.name = data_aug opt.batchsize = 48 opt.use_dense = True data_dir = data/market/pytorch -------test----------- /home/padmashree/anaconda3/envs/dataaug/lib/python3.6/site-packages/torchvision/models/densenet.py:212: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaimingnormal. nn.init.kaiming_normal(m.weight.data) load whole pretrained model: ./model/data_aug/net_29.pth Traceback (most recent call last): File "test.py", line 148, in model_siamese = load_network(model_siamese, name, opt.which_epoch) File "/home/padmashree/project_dir/data_aug_reid/model_siamese.py", line 36, in load_network pretrained_dict = net_original.state_dict() AttributeError: 'collections.OrderedDict' object has no attribute 'state_dict'

flychen321 commented 3 years ago

Please ensure that your environment is consistent with the requirements of the README.md