XiaLiPKU / EMANet

The code for Expectation-Maximization Attention Networks for Semantic Segmentation (ICCV'2019 Oral)
https://xialipku.github.io/publication/expectation-maximization-attention-networks-for-semantic-segmentation/
GNU General Public License v3.0
680 stars 130 forks source link

RuntimeError: self.net.module.load_state_dict(obj['net']) #9

Closed taotaoyuhust closed 4 years ago

taotaoyuhust commented 5 years ago

using the pretrained model throw out this error:

RuntimeError: Error(s) in loading state_dict for EMANet: Missing key(s) in state_dict: "extractor.4.0.conv1.weight", "extractor.4.0.bn1.weight", "extractor.4.0.bn1.bias", "extractor.4.0.bn1.running_mean", "extractor.4.0.bn1.running_var", "extractor.4.0.conv2.weight", ...... Unexpected key(s) in state_dict: "layer1.0.0.conv1.weight", "layer1.0.0.bn1.weight", "layer1.0.0.b

someone can help?

XiaLiPKU commented 5 years ago

Sorry, I forgot to change the keys' names

taotaoyuhust commented 5 years ago

3x for reply, so how to solve it?

XiaLiPKU commented 5 years ago

I will upload a usable pth sooner.

shiyuanyin commented 5 years ago

@XiaLiPKU , hello author, Thank you for your work, I want to ask you a question ,your EMAnet is used segment, if I am use in classification task .What do you think of the effect? If it is necessary to try , the emau structure need to change?

illutheplanet commented 5 years ago

same problem here

illutheplanet commented 5 years ago

it occurs to me: RuntimeError: Error(s) in loading state_dict for EMANet: Unexpected key(s) in state_dict: "extractor.6.0.conv1.weight", "extractor.6.0.bn1.weight", "extractor.6.0.bn1.bias", "extractor.6.0.bn1.running_mean", "extractor.6.0.bn1.running_var", "extractor.6.0.bn1.num_batches_tracked", "extractor.6.0.conv2.weight", "e

XiaLiPKU commented 5 years ago

using the pretrained model throw out this error:

RuntimeError: Error(s) in loading state_dict for EMANet: Missing key(s) in state_dict: "extractor.4.0.conv1.weight", "extractor.4.0.bn1.weight", "extractor.4.0.bn1.bias", "extractor.4.0.bn1.running_mean", "extractor.4.0.bn1.running_var", "extractor.4.0.conv2.weight", ...... Unexpected key(s) in state_dict: "layer1.0.0.conv1.weight", "layer1.0.0.bn1.weight", "layer1.0.0.b

someone can help?

Now, I have updated the pretrained model and the link. You can download it again and direct use it in your code

XiaLiPKU commented 5 years ago

it occurs to me: RuntimeError: Error(s) in loading state_dict for EMANet: Unexpected key(s) in state_dict: "extractor.6.0.conv1.weight", "extractor.6.0.bn1.weight", "extractor.6.0.bn1.bias", "extractor.6.0.bn1.running_mean", "extractor.6.0.bn1.running_var", "extractor.6.0.bn1.num_batches_tracked", "extractor.6.0.conv2.weight", "e

Now I have updated the pth file. Please download it again.