sajjjadayobi / FaceLib

Face Analysis: Detection, Age Gender Estimation & Recognition
MIT License
300 stars 52 forks source link

could not run resnet model #5

Closed pengKiina closed 4 years ago

pengKiina commented 4 years ago

Thanks for your great work, it runs mobilenet well but when I changed it to resnet the following Error incurred, Please kindly help.

RuntimeError: Error(s) in loading state_dict for RetinaFace:
    Missing key(s) in state_dict: "body.conv1.weight", "body.bn1.weight", "body.bn1.bias", "body.bn1.running_mean", "body.bn1.running_var", "body.layer1.0.conv1.weight", "body.layer1.0.bn1.weight", "body.layer1.0.bn1.bias", "body.layer1.0.bn1.running_mean", "body.layer1.0.bn1.running_var", "body.layer1.0.conv2.weight", "body.layer1.0.bn2.weight", "body.layer1.0.bn2.bias", "body.layer1.0.bn2.running_mean", "body.layer1.0.bn2.running_var", "body.layer1.0.conv3.weight", "body.layer1.0.bn3.weight", "body.layer1.0.bn3.bias", "body.layer1.0.bn3.running_mean", "body.layer1.0.bn3.running_var", "body.layer1.0.downsample.0.weight", "body.layer1.0.downsample.1.weight", "body.layer1.0.downsample.1.bias", "body.layer1.0.downsample.1.running_mean", "body.layer1.0.downsample.1.running_var", "body.layer1.1.conv1.weight", "body.layer1.1.bn1.weight", "body.layer1.1.bn1.bias", "body.layer1.1.bn1.running_mean", "body.layer1.1.bn1.running_var", "body.layer1.1.conv2.weight", "body.layer1.1.bn2.weight", "body.layer1.1.bn2.bias", "body.layer1.1.bn2.running_mean", "body.layer1.1.bn2.running_var", "body.layer1.1.conv3.weight", "body.layer1.1.bn3.weight", "body.layer1.1.bn3.bias", "body.layer1.1.bn3.running_mean", "body.layer1.1.bn3.running_var", "body.layer1.2.conv1.weight", "body.layer1.2.bn1.weight", "body.layer1.2.bn1.bias", "body.layer1.2.bn1.running_mean", "body.layer1.2.bn1.running_var", "body.layer1.2.conv2.weight", "body.layer1.2.bn2.weight", "body.layer1.2.bn2.bias", "body.layer1.2.bn2.runnin...
    Unexpected key(s) in state_dict: "module.body.conv1.weight", "module.body.bn1.weight", "module.body.bn1.bias", "module.body.bn1.running_mean", "module.body.bn1.running_var", "module.body.bn1.num_batches_tracked", "module.body.layer1.0.conv1.weight", "module.body.layer1.0.bn1.weight", "module.body.layer1.0.bn1.bias", "module.body.layer1.0.bn1.running_mean", "module.body.layer1.0.bn1.running_var", "module.body.layer1.0.bn1.num_batches_tracked", "module.body.layer1.0.conv2.weight", "module.body.layer1.0.bn2.weight", "module.body.layer1.0.bn2.bias", "module.body.layer1.0.bn2.running_mean", "module.body.layer1.0.bn2.running_var", "module.body.layer1.0.bn2.num_batches_tracked", "module.body.layer1.0.conv3.weight", "module.body.layer1.0.bn3.weight", "module.body.layer1.0.bn3.bias", "module.body.layer1.0.bn3.running_mean", "module.body.layer1.0.bn3.running_var", "module.body.layer1.0.bn3.num_batches_tracked", "module.body.layer1.0.downsample.0.weight", "module.body.layer1.0.downsample.1.weight", "module.body.layer1.0.downsample.1.bias", "module.body.layer1.0.downsample.1.running_mean", "module.body.layer1.0.downsample.1.running_var", "module.body.layer1.0.downsample.1.num_batches_tracked", "module.body.layer1.1.conv1.weight", "module.body.layer1.1.bn1.weight", "module.body.layer1.1.bn1.bias", "module.body.layer1.1.bn1.running_mean", "module.body.layer1.1.bn1.running_var", "module.body.layer1.1.bn1.num_batches_tracked", "module.body.layer1.1.conv2.weight", "module.body.layer1.1.bn...
sajjjadayobi commented 4 years ago

probably you forget to change the model name you just changed the weight_path

pengKiina commented 4 years ago

Thanks, I will try it.