Error loading market1501 osnet_x1_0 weights under Same-domain ReID in model zoo
See original GitHub issueHi!
I am trying to load the pretrained market1501 osnet_x1_0
weights under https://kaiyangzhou.github.io/deep-person-reid/MODEL_ZOO.html#same-domain-reid by:
datamanager = torchreid.data.ImageDataManager(
root='reid-data',
sources='market1501',
targets='market1501',
height=256,
width=128,
batch_size_train=32,
batch_size_test=100,
transforms=['random_flip', 'random_crop']
)
model = models.build_model(name='osnet_x1_0', num_classes=datamanager.num_train_pids)
torchreid.utils.load_pretrained_weights(model, weight_path='/x/osnet_x1_0_market_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip.pth')
but I get:
** The following layers are discarded due to unmatched keys or layer size: ['classifier.weight', 'classifier.bias']
The weights name has market in it so I supposed it was trained on 1501 classes but this is not the case. Anybody knows that the problem is here?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Need to download datasets ? #111 - GitHub
Have a simple question on how to use the pretrained versions on a given dataset or my own one. I got the weights...
Read more >torchreid 1.4.0 documentation - Kaiyang Zhou
Torchreid is a library for deep-learning person re-identification, written in PyTorch and developed for our ICCV'19 project, Omni-Scale Feature Learning for ...
Read more >Model Zoo - Deep learning code and pretrained models for ...
ModelZoo curates and provides a platform for deep learning researchers to easily find code and pre-trained models for a variety of platforms and...
Read more >FiftyOne Model Zoo - Voxel51
FiftyOne provides a Model Zoo that contains a collection of pre-trained models that you can download and run inference on your FiftyOne Datasets...
Read more >Market-1501 Benchmark (Person Re-Identification)
Rank Model mAP Rank‑1 Rank‑5 Rank‑10 Year
1 CTL Model (ResNet‑50, 256x128) 98.3 98.0 98.6 99.5 2021
2 Unsupervised Pre‑training (ResNet101+RK) 96.21 2020
3 RGT&RGPR (RK)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are totally right there @sholevs66.
Then I guess it would be better to use the FeatureExtractor right away:
instead of
Well, there are 751 identities for train and 750 for test. So, it fits. Eitherway, if you are using a trained model for eval on the test set, you are ignoring the final classification layer, instead you take the 512-d embedding vector for matching with the gallery. You can verify it by running:
datamanager.num_train_pids
for the market1501 data manager youv’e created.Yea, I see the mismatch you talk about between the paper performance and the provided models in the git. I have started training the ImageNet pretrained model on the market1501 and I still haven’t passed the 91% CMC1, while the paper has >93 for either model (pre train ImageNet + market train, or fully market train from scratch). Still playing with it.
hope this helps