Open ForeUP opened 1 year ago
hi, you can check two things first.
convert_weights
parameter has been set to True.
https://github.com/tinyvision/SOLIDER-REID/blob/c35c07671ceb16f72bb7c8fd94929ef436b9406b/model/backbones/swin_transformer.py#L1313
If not, it may be caused by the wrong setting of MODEL.PRETRAIN_CHOICE. You should set MODEL.PRETRAIN_CHOICE to 'self' as described in run.sh
. hi, you can check two things first.
- use the pre-trained model from SOLIDER;
check whether the
convert_weights
parameter has been set to True. https://github.com/tinyvision/SOLIDER-REID/blob/c35c07671ceb16f72bb7c8fd94929ef436b9406b/model/backbones/swin_transformer.py#L1313If not, it may be caused by the wrong setting of MODEL.PRETRAIN_CHOICE. You should set MODEL.PRETRAIN_CHOICE to 'self' as described in
run.sh
.
I have tried to set convert_weights=True
and convert_weights=True
, and the errors are same as before.
And before that I have use convert_model.py
to convert SOLIDER pretrained model.
I change the code as below, so the table_key
will obtain from the model itself, and run successfully.
I'm not sure if this is the correct way to do it, but I have not encountered any errors in doing so.
# interpolate position bias table if needed
relative_position_bias_table_keys = [
# k for k in state_dict.keys()
k for k in self.state_dict().keys()
if 'relative_position_bias_table' in k
]
I try to run swin_small model, and I have convert_model to teacher model, met an error like fllow:
It may means that could not fund a dict key in
self.state_dict()
, and I found thetable_key
is obtain from thepretained model
. Should I change the source oftable key
to obrain thetable_key
from theSwinTransformer model itself
or its just my error not the code.