songqi-github / AttaNet

AttaNet for real-time semantic segmentation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading the pretrained model

yangpanquan opened this issue · comments

when I loaded the pretrained model ,'resnet18-5c106cde.pth', there is a error during the training. As showed below.

Missing key(s) in state_dict: "head.resnet.conv1.weight", "head.resnet.bn1.weight", "head.resnet.bn1.bias", "head.resnet.bn1.running_mean", "head.resnet.bn1.running_var",.......
Unexpected key(s) in state_dict: "conv1.weight", "bn1.running_mean", "bn1.running_var", "bn1.weight", "bn1.bias", "layer1.0.conv1.weight", "layer1.0.bn1.running_mean",........
Do you know how to fix it?

Maybe the ckpt file is broken. You can download the pretrained model from BaiduYun(Access Code:bw0y) .

Thank you, I 'll try it again. Can I ask you another question? what does the palette file do? Why the number of element in cityscapes_palette list is 768? According to the function of get_voc_palette, the input of function is num_classes, the total classes of cityscapes is 35, output is 105. May be I get it wrong.

The palette.py can be used to visualize segmentation results. The number represents the corresponding color value, you can refer to Cityscapes' official website for more details. As I don't use the palette.py in my code, I delete this file from the repository for clear understanding.

Ok, thank you again for your detail answer.