microsoft / ProDA

Prototypical Pseudo Label Denoising and Target Structure Learning for Domain Adaptive Semantic Segmentation (CVPR 2021)
https://arxiv.org/abs/2101.10979
MIT License
286 stars 44 forks source link

Missing key(s) in state_dict #26

Closed y72428026 closed 3 years ago

y72428026 commented 3 years ago

hello~Thanks for your excellent work, but now I meet a problem when I try to follow the steps in "Inference Using Pretrained Model"-"2) GTA -> Cityscapes". It throws a error: RuntimeError: Error(s) in loading state_dict for ResNet101: Missing key(s) in state_dict: "bn_pretrain.weight", "bn_pretrain.bias", "bn_pretrain.running_mean", "bn_pretrain.running_var". image if anyone meet the same error?

JiangXiaobai00 commented 3 years ago

I also encounter this problem !

ljjcoder commented 2 years ago

I also encounter this problem ! Anyone fixed it?

michaelku1 commented 2 years ago

the downloaded pretrained weights have those keys where your initialised model is missing, so you need to go to the line where stage1 model is initialised and add the bn_clr=opt.bn_clr to it, and then you will have to specify --bn_clr in your command line to flag bn_clr to True (bn_clr is a batchnorm layer)