chenhao2345 / ICE

Implementation for ICCV 2021 paper "ICE: Inter-instance Contrastive Encoding for Unsupervised Person Re-identification"
MIT License
44 stars 15 forks source link

About ResNet50_IBN network #5

Closed YangJae96 closed 2 years ago

YangJae96 commented 2 years ago

Hi, I am getting error when I tried to train your network with ResNet50_IBN.

I gave the arguments like this "python examples/unsupervised_train.py --dataset-target market1501 --a rch resnet_ibn50a"

File "examples/unsupervised_train.py", line 94, in create_model model_1 = models.create(args.arch, num_features=args.features, dropout=args.dropout, num_classes=0) File "/root/workplace/re-Id/ICE/ice/models/init.py", line 54, in create return factory[name](*args, kwargs) File "/root/workplace/re-Id/ICE/ice/models/resnet_ibn.py", line 130, in resnet_ibn50a return ResNetIBN('50a', kwargs) File "/root/workplace/re-Id/ICE/ice/models/resnet_ibn.py", line 29, in init resnet = ResNetIBN.__factorydepth File "/root/workplace/re-Id/ICE/ice/models/resnet_ibn_a.py", line 187, in resnet50_ibn_a state_dict = torch.load(model_urls['ibn_resnet50a'], map_location=torch.device('cpu'))['state_dict'] File "/root/anaconda3/envs/ICE/lib/python3.8/site-packages/torch-1.7.0-py3.8-linux-x86_64.egg/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/root/anaconda3/envs/ICE/lib/python3.8/site-packages/torch-1.7.0-py3.8-linux-x86_64.egg/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/root/anaconda3/envs/ICE/lib/python3.8/site-packages/torch-1.7.0-py3.8-linux-x86_64.egg/torch/serialization.py", line 211, in init super(_open_file, self).init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/home/hchen/Projects/Baseline/logs/pretrained/resnet50_ibn_a.pth.tar'

How can I load the pretrained weights of ResNet50-IBN?

chenhao2345 commented 2 years ago

Hi, you need to modify the following line to your weight path.

https://github.com/chenhao2345/ICE/blob/a206eb9a97ad431ab9d9cf38cdcf5ab6fdc6ad1c/ice/models/resnet_ibn_a.py#L11

YangJae96 commented 2 years ago

Oh, I see.

How did you download the pretrained ResNet50 IBN-a.pth.tar?

Can't find the source now.

chenhao2345 commented 2 years ago

I got it from SpCL project. You can download pretrained ResNet50 IBN-a.pth.tar from this Google Drive.

YangJae96 commented 2 years ago

Thank you!!