Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The model and loaded state dict do not match exactly #53

Open
xukaiquan opened this issue May 10, 2020 · 4 comments
Open

The model and loaded state dict do not match exactly #53

xukaiquan opened this issue May 10, 2020 · 4 comments

Comments

@xukaiquan
Copy link

Dear Authors,

When I try the landmark detector demo, I meet the following issues. Please give one good demo or example. Thanks

pretrained model checkpoint/vgg16.pth
The model and loaded state dict do not match exactly

unexpected key in source state_dict: classifier.0.weight, classifier.0.bias, classifier.3.weight, classifier.3.bias, classifier.6.weight, classifier.6.bias

model built
load checkpoint from: checkpoint/LandmarkDetect/global/landmark_detect_best.pth
F:\Python\Anaconda3\envs\cuhk_mmlab\lib\site-packages\torch\nn\functional.py:1569: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
detected landmark [ 49.13241 134.01773] [169.72472 133.90952]
detected landmark [169.72472 133.90952] [ 67.13259 172.5399 ]
detected landmark [ 67.13259 172.5399 ] [151.30598 170.36455]

@veralauee
Copy link
Collaborator

It already load the right model.
Note that the model is firstly initialized via "vgg16.pth" where it comes up with some unexpected keys. But after the model built, it "load checkpoint from: checkpoint/LandmarkDetect/global/landmark_detect_best.pth".
The model is loaded successfully.

@Wangnaijia
Copy link

Hello, I wonder if i have downloaded the right model? The result of landmark detector seems poor, here I used the vgg16 model downloaded from baidu drive, and got only three landmarks on the landmark_predict/demo1.jpg. How can I get better detection like shown in the gif?

python demo/test_landmark_detector.py --input demo/imgs/landmark_predict/demo1.jpg
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-9.0'
pretrained model checkpoint/vgg16.pth
The model and loaded state dict do not match exactly

unexpected key in source state_dict: classifier.0.weight, classifier.0.bias, classifier.3.weight, classifier.3.bias, classifier.6.weight, classifier.6.bias

model built
load checkpoint from: checkpoint/LandmarkDetect/global/landmark_detect_best.pth
/home/wnj/venvs/Pytorch/lib/python3.6/site-packages/torch/nn/functional.py:1351: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
detected landmark 36.98792670454298 165.01900127955847
detected landmark 166.21276821408955 165.32434395381384
detected landmark 55.93586351190295 166.0515904426575

@xinzi2018
Copy link

i have the same question!!!

@FeatureSpitter
Copy link

This project is unusable, what a pitty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants