tinyvision / SOLIDER-REID

MIT License
55 stars 12 forks source link

load pretrained model issue #14

Closed Realdr4g0n closed 11 months ago

Realdr4g0n commented 12 months ago

Hello. Thank you for sharing your research. I have a question regarding the process of loading a pretrained model from the SOLIDER repository. It seems that the model is not being loaded correctly. Is this intentional?

To provide a detailed explanation, in the file SOLIDER-REID/model/make_model.py, on line 193, the model is loaded once through init_model, and then there is an additional loading process if pretrained_choice is set to self. However, in the second load when pretrained_choice is self, not all keys are matched, and nothing is done. Is this the intended code?

I am confused about how to apply this process when training my own dataset. I would greatly appreciate it if you could provide some guidance.

cwhgn commented 12 months ago

Thanks for your attention. The pre-trained model is only loaded once, i.e., through SOLIDER-REID/model/make_model.py, on line 193. "An additional loading process if pretrained_choice is set to self" in your question, do you mean the code in line 228? They are from the original TransReID repo and not suitable for our case. If your want to use the pretrained model from SOLIDER, you should set the pretrained_choice to imagenet. If your want to use the model trained from SOLIDER-REID as init model for resuming, you can follow the steps in ISSUE#5.

Realdr4g0n commented 11 months ago

Oh I think I got confused after seeing this reply. The task I'm trying to do is to train my dataset with the SOLIDER backbone pretrained on LU Person.

According to this reply, if you want to use the SOLIDER pretrained model, you have to enter the parameter as self. Does the SOLIDER pretrained here mean a fine tuned model like market1501? As I said before, I only want to load the SOLIDER backbone and fine-tune it by learning from my data.

Thanks again for sharing your great research and I look forward to your reply.

p.s) And the load weight I said is correct to mean the 228 line you said.

cwhgn commented 11 months ago

If you want to use the SOLIDER pretrained model, you have to enter the parameter as imagenet. self is used for the model from SOLIDER-REID repo, not from SOLIDER repo.