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

Question about model_type, num_classes,image size ? #43

Closed
bit2001 opened this issue Nov 10, 2020 · 7 comments
Closed

Question about model_type, num_classes,image size ? #43

bit2001 opened this issue Nov 10, 2020 · 7 comments

Comments

@bit2001
Copy link

bit2001 commented Nov 10, 2020

Hi,
First, thanks for your excellent product.
I am currently testing your ant-spoofing program.
There are some question.

  1. What is the role of "model_type"(MiniFASNetV1/MiniFASNetV2/MiniFASNetV1SE/MiniFASNetV2SE) ?
    There is only 4 items or can be added ?

  2. What is the role of "num_classes" ?
    There is 3 or 4 in your source ...
    the 3 or 4 means "0" , "1", "2" ?
    ├── datasets
    └── RGB_Images
    ├── org_1_80x60
    ├── 0
    ├── 1
    └── 2
    What is the meaning 0/1/2 respectively ?

    If I want to 2 kind of classes(Real Face , Fake Face) , I can change 3 or 4 to 2 in your source ?

  3. I want to train the 2 kind images(Real Face / Fake Face)
    3.1) I can compose dataset like below ?
    It is reasonable ?
    ├── datasets
    └── RGB_Images
    ├── 1_230x230
    ├── Real
    ├── RealFace1.jpg
    ├── ....
    └── Fake
    ├── FakeFace1.jpg
    ├── FakeFace2.jpg
    ├── ...

         In your source the is only org_1x80x60 , 1_80x80 , 2.7_80x80 , 4_80x80.
         I have image (203x203)
         I should make image size as yoy did ?
           for example,  org_1x203x203 , 1_80x80 , 2.7_80x80 , 4_80x80. ...
    

    3.2) after finishing training, how do I name the output => snapshot .pth and copy it to "Silent-Face-Anti-Spoofing-master\resources\anti_spoof_models"
    Do I name it as "1_80x80_MiniFASNetV2.pth" or another name or "1_230x230_MiniFASNetV2.pth" or new what ?
    Of course , I anlayzed your source but it is a little bit confusing .

Thanks in Advance

@bit2001
Copy link
Author

bit2001 commented Nov 11, 2020

In addition,
I have another question.
I resized image to 80 * 80 * 3(channels) and retrained in linux.
After retrain, I copy 2020-11-10-22-29_Anti_Spoofing_1_80x80_model_iter-4950.pth to resources\anti_spoof_models\1_80x80_MiniFASNetV2SE.pth.

I test it like "python test.py".

The follow error occurred.

Traceback (most recent call last):
File "test.py", line 109, in
test(args.image_name, args.model_dir, args.device_id)
File "test.py", line 59, in test
prediction += model_test.predict(img, os.path.join(model_dir, model_name))
File "D:\WorkSpace2\Silent-Face-Anti-Spoofing-master\Silent-Face-Anti-Spoofing-master\src\anti_spoof_predict.py", line 87, in predict
self._load_model(model_path)
File "D:\WorkSpace2\Silent-Face-Anti-Spoofing-master\Silent-Face-Anti-Spoofing-master\src\anti_spoof_predict.py", line 76, in _load_model
self.model.load_state_dict(new_state_dict)
File "C:\Users\SDS\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 777, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for MiniFASNetSE:
Missing key(s) in state_dict: "conv1.conv.weight", "conv1.bn.weight", "conv1.bn.bias", "conv1.bn.running_mean", "conv1.bn.running_var", "conv1.prelu.weight", "conv2_dw.conv.weight", "conv2_dw.bn.weight", "conv2_dw.bn.bias", "conv2_dw.bn.running_mean", "conv2_dw.bn.running_var", "conv2_dw.prelu.weight", "conv_23.conv.conv.weight", "conv_23.conv.bn.weight", "conv_23.conv.bn.bias", "conv_23.conv.bn.running_mean", "conv_23.conv.bn.running_var", "conv_23.conv.prelu.weight", "conv_23.conv_dw.conv.weight", "conv_23.conv_dw.bn.weight", "conv_23.conv_dw.bn.bias", "conv_23.conv_dw.bn.running_mean", "conv_23.conv_dw.bn.running_var", "conv_23.conv_dw.prelu.weight", "conv_23.project.conv.weight", "conv_23.project.bn.weight", "conv_23.project.bn.bias", "conv_23.project.bn.running_mean", "conv_23.project.bn.running_var", "conv_3.model.0.conv.conv.weight", "conv_3.model.0.conv.bn.weight", "conv_3.model.0.conv.bn.bias", "conv_3.model.0.conv.bn.running_mean", "conv_3.model.0.conv.bn.running_var", "conv_3.model.0.conv.prelu.weight", "conv_3.model.0.conv_dw.conv.weight", "conv_3.model.0.conv_dw.bn.weight", "conv_3.model.0.conv_dw.bn.bias", "conv_3.model.0.conv_dw.bn.running_mean", "conv_3.model.0.conv_dw.bn.running_var", "conv_3.model.0.conv_dw.prelu.weight", "conv_3.model.0.project.conv.weight", "conv_3.model.0.project.bn.weight", "conv_3.model.0.project.bn.bias", "conv_3.model.0.project.bn.running_mean", "conv_3.model.0.project.bn.running_var", "conv_3.model.1.conv.conv.weight", "conv_3.model.1.conv.bn.weight", "conv_3.model.1.conv.bn.bias", "conv_3.model.1.conv.bn.running_mean", "conv_3.model.1.conv.bn.running_var", "conv_3.model.1.conv.prelu.weight", "conv_3.model.1.conv_dw.conv.weight", "conv_3.model.1.conv_dw.bn.weight", "conv_3.model.1.conv_dw.bn.bias", "conv_3.model.1.conv_dw.bn.running_mean", "conv_3.model.1.conv_dw.bn.running_var", "conv_3.model.1.conv_dw.prelu.weight", "conv_3.model.1.project.conv.weight", "conv_3.model.1.project.bn.weight", "conv_3.model.1.project.bn.bias", "conv_3.model.1.project.bn.running_mean", "conv_3.model.1.project.bn.running_var", "conv_3.model.2.conv.conv.weight", "conv_3.model.2.conv.bn.weight", "conv_3.model.2.conv.bn.bias", "conv_3.model.2.conv.bn.running_mean", "conv_3.model.2.conv.bn.running_var", "conv_3.model.2.conv.prelu.weight", "conv_3.model.2.conv_dw.conv.weight", "conv_3.model.2.conv_dw.bn.weight", "conv_3.model.2.conv_dw.bn.bias", "conv_3.model.2.conv_dw.bn.running_mean", "conv_3.model.2.conv_dw.bn.running_var", "conv_3.model.2.conv_dw.prelu.weight", "conv_3.model.2.project.conv.weight", "conv_3.model.2.project.bn.weight", "conv_3.model.2.project.bn.bias", "conv_3.model.2.project.bn.running_mean", "conv_3.model.2.project.bn.running_var", "conv_3.model.3.conv.conv.weight", "conv_3.model.3.conv.bn.weight", "conv_3.model.3.conv.bn.bias", "conv_3.model.3.conv.bn.running_mean", "conv_3.model.3.conv.bn.running_var", "conv_3.model.3.conv.prelu.weight", "conv_3.model.3.conv_dw.conv.weight", "conv_3.model.3.conv_dw.bn.weight", "conv_3.model.3.conv_dw.bn.bias", "conv_3.model.3.conv_dw.bn.running_mean", "conv_3.model.3.conv_dw.bn.running_var", "conv_3.model.3.conv_dw.prelu.weight", "conv_3.model.3.project.conv.weight", "conv_3.model.3.project.bn.weight", "conv_3.model.3.project.bn.bias", "conv_3.model.3.project.bn.running_mean", "conv_3.model.3.project.bn.running_var", "conv_3.model.3.se_module.fc1.weight", "conv_3.model.3.se_module.bn1.weight", "conv_3.model.3.se_module.bn1.bias", "conv_3.model.3.se_module.bn1.running_mean", "conv_3.model.3.se_module.bn1.running_var", "conv_3.model.3.se_module.fc2.weight", "conv_3.model.3.se_module.bn2.weight", "conv_3.model.3.se_module.bn2.bias", "conv_3.model.3.se_module.bn2.running_mean", "conv_3.model.3.se_module.bn2.running_var", "conv_34.conv.conv.weight", "conv_34.conv.bn.weight", "conv_34.conv.bn.bias", "conv_34.conv.bn.running_mean", "conv_34.conv.bn.running_var", "conv_34.conv.prelu.weight", "conv_34.conv_dw.conv.weight", "conv_34.conv_dw.bn.weight", "conv_34.conv_dw.bn.bias", "conv_34.conv_dw.bn.running_mean", "conv_34.conv_dw.bn.running_var", "conv_34.conv_dw.prelu.weight", "conv_34.project.conv.weight", "conv_34.project.bn.weight", "conv_34.project.bn.bias", "conv_34.project.bn.running_mean", "conv_34.project.bn.running_var", "conv_4.model.0.conv.conv.weight", "conv_4.model.0.conv.bn.weight", "conv_4.model.0.conv.bn.bias", "conv_4.model.0.conv.bn.running_mean", "conv_4.model.0.conv.bn.running_var", "conv_4.model.0.conv.prelu.weight", "conv_4.model.0.conv_dw.conv.weight", "conv_4.model.0.conv_dw.bn.weight", "conv_4.model.0.conv_dw.bn.bias", "conv_4.model.0.conv_dw.bn.running_mean", "conv_4.model.0.conv_dw.bn.running_var", "conv_4.model.0.conv_dw.prelu.weight", "conv_4.model.0.project.conv.weight", "conv_4.model.0.project.bn.weight", "conv_4.model.0.project.bn.bias", "conv_4.model.0.project.bn.running_mean", "conv_4.model.0.project.bn.running_var", "conv_4.model.1.conv.conv.weight", "conv_4.model.1.conv.bn.weight", "conv_4.model.1.conv.bn.bias", "conv_4.model.1.conv.bn.running_mean", "conv_4.model.1.conv.bn.running_var", "conv_4.model.1.conv.prelu.weight", "conv_4.model.1.conv_dw.conv.weight", "conv_4.model.1.conv_dw.bn.weight", "conv_4.model.1.conv_dw.bn.bias", "conv_4.model.1.conv_dw.bn.running_mean", "conv_4.model.1.conv_dw.bn.running_var", "conv_4.model.1.conv_dw.prelu.weight", "conv_4.model.1.project.conv.weight", "conv_4.model.1.project.bn.weight", "conv_4.model.1.project.bn.bias", "conv_4.model.1.project.bn.running_mean", "conv_4.model.1.project.bn.running_var", "conv_4.model.2.conv.conv.weight", "conv_4.model.2.conv.bn.weight", "conv_4.model.2.conv.bn.bias", "conv_4.model.2.conv.bn.running_mean", "conv_4.model.2.conv.bn.running_var", "conv_4.model.2.conv.prelu.weight", "conv_4.model.2.conv_dw.conv.weight", "conv_4.model.2.conv_dw.bn.weight", "conv_4.model.2.conv_dw.bn.bias", "conv_4.model.2.conv_dw.bn.running_mean", "conv_4.model.2.conv_dw.bn.running_var", "conv_4.model.2.conv_dw.prelu.weight", "conv_4.model.2.project.conv.weight", "conv_4.model.2.project.bn.weight", "conv_4.model.2.project.bn.bias", "conv_4.model.2.project.bn.running_mean", "conv_4.model.2.project.bn.running_var", "conv_4.model.3.conv.conv.weight", "conv_4.model.3.conv.bn.weight", "conv_4.model.3.conv.bn.bias", "conv_4.model.3.conv.bn.running_mean", "conv_4.model.3.conv.bn.running_var", "conv_4.model.3.conv.prelu.weight", "conv_4.model.3.conv_dw.conv.weight", "conv_4.model.3.conv_dw.bn.weight", "conv_4.model.3.conv_dw.bn.bias", "conv_4.model.3.conv_dw.bn.running_mean", "conv_4.model.3.conv_dw.bn.running_var", "conv_4.model.3.conv_dw.prelu.weight", "conv_4.model.3.project.conv.weight", "conv_4.model.3.project.bn.weight", "conv_4.model.3.project.bn.bias", "conv_4.model.3.project.bn.running_mean", "conv_4.model.3.project.bn.running_var", "conv_4.model.4.conv.conv.weight", "conv_4.model.4.conv.bn.weight", "conv_4.model.4.conv.bn.bias", "conv_4.model.4.conv.bn.running_mean", "conv_4.model.4.conv.bn.running_var", "conv_4.model.4.conv.prelu.weight", "conv_4.model.4.conv_dw.conv.weight", "conv_4.model.4.conv_dw.bn.weight", "conv_4.model.4.conv_dw.bn.bias", "conv_4.model.4.conv_dw.bn.running_mean", "conv_4.model.4.conv_dw.bn.running_var", "conv_4.model.4.conv_dw.prelu.weight", "conv_4.model.4.project.conv.weight", "conv_4.model.4.project.bn.weight", "conv_4.model.4.project.bn.bias", "conv_4.model.4.project.bn.running_mean", "conv_4.model.4.project.bn.running_var", "conv_4.model.5.conv.conv.weight", "conv_4.model.5.conv.bn.weight", "conv_4.model.5.conv.bn.bias", "conv_4.model.5.conv.bn.running_mean", "conv_4.model.5.conv.bn.running_var", "conv_4.model.5.conv.prelu.weight", "conv_4.model.5.conv_dw.conv.weight", "conv_4.model.5.conv_dw.bn.weight", "conv_4.model.5.conv_dw.bn.bias", "conv_4.model.5.conv_dw.bn.running_mean", "conv_4.model.5.conv_dw.bn.running_var", "conv_4.model.5.conv_dw.prelu.weight", "conv_4.model.5.project.conv.weight", "conv_4.model.5.project.bn.weight", "conv_4.model.5.project.bn.bias", "conv_4.model.5.project.bn.running_mean", "conv_4.model.5.project.bn.running_var", "conv_4.model.5.se_module.fc1.weight", "conv_4.model.5.se_module.bn1.weight", "conv_4.model.5.se_module.bn1.bias", "conv_4.model.5.se_module.bn1.running_mean", "conv_4.model.5.se_module.bn1.running_var", "conv_4.model.5.se_module.fc2.weight", "conv_4.model.5.se_module.bn2.weight", "conv_4.model.5.se_module.bn2.bias", "conv_4.model.5.se_module.bn2.running_mean", "conv_4.model.5.se_module.bn2.running_var", "conv_45.conv.conv.weight", "conv_45.conv.bn.weight", "conv_45.conv.bn.bias", "conv_45.conv.bn.running_mean", "conv_45.conv.bn.running_var", "conv_45.conv.prelu.weight", "conv_45.conv_dw.conv.weight", "conv_45.conv_dw.bn.weight", "conv_45.conv_dw.bn.bias", "conv_45.conv_dw.bn.running_mean", "conv_45.conv_dw.bn.running_var", "conv_45.conv_dw.prelu.weight", "conv_45.project.conv.weight", "conv_45.project.bn.weight", "conv_45.project.bn.bias", "conv_45.project.bn.running_mean", "conv_45.project.bn.running_var", "conv_5.model.0.conv.conv.weight", "conv_5.model.0.conv.bn.weight", "conv_5.model.0.conv.bn.bias", "conv_5.model.0.conv.bn.running_mean", "conv_5.model.0.conv.bn.running_var", "conv_5.model.0.conv.prelu.weight", "conv_5.model.0.conv_dw.conv.weight", "conv_5.model.0.conv_dw.bn.weight", "conv_5.model.0.conv_dw.bn.bias", "conv_5.model.0.conv_dw.bn.running_mean", "conv_5.model.0.conv_dw.bn.running_var", "conv_5.model.0.conv_dw.prelu.weight", "conv_5.model.0.project.conv.weight", "conv_5.model.0.project.bn.weight", "conv_5.model.0.project.bn.bias", "conv_5.model.0.project.bn.running_mean", "conv_5.model.0.project.bn.running_var", "conv_5.model.1.conv.conv.weight", "conv_5.model.1.conv.bn.weight", "conv_5.model.1.conv.bn.bias", "conv_5.model.1.conv.bn.running_mean", "conv_5.model.1.conv.bn.running_var", "conv_5.model.1.conv.prelu.weight", "conv_5.model.1.conv_dw.conv.weight", "conv_5.model.1.conv_dw.bn.weight", "conv_5.model.1.conv_dw.bn.bias", "conv_5.model.1.conv_dw.bn.running_mean", "conv_5.model.1.conv_dw.bn.running_var", "conv_5.model.1.conv_dw.prelu.weight", "conv_5.model.1.project.conv.weight", "conv_5.model.1.project.bn.weight", "conv_5.model.1.project.bn.bias", "conv_5.model.1.project.bn.running_mean", "conv_5.model.1.project.bn.running_var", "conv_5.model.1.se_module.fc1.weight", "conv_5.model.1.se_module.bn1.weight", "conv_5.model.1.se_module.bn1.bias", "conv_5.model.1.se_module.bn1.running_mean", "conv_5.model.1.se_module.bn1.running_var", "conv_5.model.1.se_module.fc2.weight", "conv_5.model.1.se_module.bn2.weight", "conv_5.model.1.se_module.bn2.bias", "conv_5.model.1.se_module.bn2.running_mean", "conv_5.model.1.se_module.bn2.running_var", "conv_6_sep.conv.weight", "conv_6_sep.bn.weight", "conv_6_sep.bn.bias", "conv_6_sep.bn.running_mean", "conv_6_sep.bn.running_var", "conv_6_sep.prelu.weight", "conv_6_dw.conv.weight", "conv_6_dw.bn.weight", "conv_6_dw.bn.bias", "conv_6_dw.bn.running_mean", "conv_6_dw.bn.running_var", "linear.weight", "bn.weight", "bn.bias", "bn.running_mean", "bn.running_var", "prob.weight".
Unexpected key(s) in state_dict: "model.conv1.conv.weight", "model.conv1.bn.weight", "model.conv1.bn.bias", "model.conv1.bn.running_mean", "model.conv1.bn.running_var", "model.conv1.bn.num_batches_tracked", "model.conv1.prelu.weight", "model.conv2_dw.conv.weight", "model.conv2_dw.bn.weight", "model.conv2_dw.bn.bias", "model.conv2_dw.bn.running_mean", "model.conv2_dw.bn.running_var", "model.conv2_dw.bn.num_batches_tracked", "model.conv2_dw.prelu.weight", "model.conv_23.conv.conv.weight", "model.conv_23.conv.bn.weight", "model.conv_23.conv.bn.bias", "model.conv_23.conv.bn.running_mean", "model.conv_23.conv.bn.running_var", "model.conv_23.conv.bn.num_batches_tracked", "model.conv_23.conv.prelu.weight", "model.conv_23.conv_dw.conv.weight", "model.conv_23.conv_dw.bn.weight", "model.conv_23.conv_dw.bn.bias", "model.conv_23.conv_dw.bn.running_mean", "model.conv_23.conv_dw.bn.running_var", "model.conv_23.conv_dw.bn.num_batches_tracked", "model.conv_23.conv_dw.prelu.weight", "model.conv_23.project.conv.weight", "model.conv_23.project.bn.weight", "model.conv_23.project.bn.bias", "model.conv_23.project.bn.running_mean", "model.conv_23.project.bn.running_var", "model.conv_23.project.bn.num_batches_tracked", "model.conv_3.model.0.conv.conv.weight", "model.conv_3.model.0.conv.bn.weight", "model.conv_3.model.0.conv.bn.bias", "model.conv_3.model.0.conv.bn.running_mean", "model.conv_3.model.0.conv.bn.running_var", "model.conv_3.model.0.conv.bn.num_batches_tracked", "model.conv_3.model.0.conv.prelu.weight", "model.conv_3.model.0.conv_dw.conv.weight", "model.conv_3.model.0.conv_dw.bn.weight", "model.conv_3.model.0.conv_dw.bn.bias", "model.conv_3.model.0.conv_dw.bn.running_mean", "model.conv_3.model.0.conv_dw.bn.running_var", "model.conv_3.model.0.conv_dw.bn.num_batches_tracked", "model.conv_3.model.0.conv_dw.prelu.weight", "model.conv_3.model.0.project.conv.weight", "model.conv_3.model.0.project.bn.weight", "model.conv_3.model.0.project.bn.bias", "model.conv_3.model.0.project.bn.running_mean", "model.conv_3.model.0.project.bn.running_var", "model.conv_3.model.0.project.bn.num_batches_tracked", "model.conv_3.model.1.conv.conv.weight", "model.conv_3.model.1.conv.bn.weight", "model.conv_3.model.1.conv.bn.bias", "model.conv_3.model.1.conv.bn.running_mean", "model.conv_3.model.1.conv.bn.running_var", "model.conv_3.model.1.conv.bn.num_batches_tracked", "model.conv_3.model.1.conv.prelu.weight", "model.conv_3.model.1.conv_dw.conv.weight", "model.conv_3.model.1.conv_dw.bn.weight", "model.conv_3.model.1.conv_dw.bn.bias", "model.conv_3.model.1.conv_dw.bn.running_mean", "model.conv_3.model.1.conv_dw.bn.running_var", "model.conv_3.model.1.conv_dw.bn.num_batches_tracked", "model.conv_3.model.1.conv_dw.prelu.weight", "model.conv_3.model.1.project.conv.weight", "model.conv_3.model.1.project.bn.weight", "model.conv_3.model.1.project.bn.bias", "model.conv_3.model.1.project.bn.running_mean", "model.conv_3.model.1.project.bn.running_var", "model.conv_3.model.1.project.bn.num_batches_tracked", "model.conv_3.model.2.conv.conv.weight", "model.conv_3.model.2.conv.bn.weight", "model.conv_3.model.2.conv.bn.bias", "model.conv_3.model.2.conv.bn.running_mean", "model.conv_3.model.2.conv.bn.running_var", "model.conv_3.model.2.conv.bn.num_batches_tracked", "model.conv_3.model.2.conv.prelu.weight", "model.conv_3.model.2.conv_dw.conv.weight", "model.conv_3.model.2.conv_dw.bn.weight", "model.conv_3.model.2.conv_dw.bn.bias", "model.conv_3.model.2.conv_dw.bn.running_mean", "model.conv_3.model.2.conv_dw.bn.running_var", "model.conv_3.model.2.conv_dw.bn.num_batches_tracked", "model.conv_3.model.2.conv_dw.prelu.weight", "model.conv_3.model.2.project.conv.weight", "model.conv_3.model.2.project.bn.weight", "model.conv_3.model.2.project.bn.bias", "model.conv_3.model.2.project.bn.running_mean", "model.conv_3.model.2.project.bn.running_var", "model.conv_3.model.2.project.bn.num_batches_tracked", "model.conv_3.model.3.conv.conv.weight", "model.conv_3.model.3.conv.bn.weight", "model.conv_3.model.3.conv.bn.bias", "model.conv_3.model.3.conv.bn.running_mean", "model.conv_3.model.3.conv.bn.running_var", "model.conv_3.model.3.conv.bn.num_batches_tracked", "model.conv_3.model.3.conv.prelu.weight", "model.conv_3.model.3.conv_dw.conv.weight", "model.conv_3.model.3.conv_dw.bn.weight", "model.conv_3.model.3.conv_dw.bn.bias", "model.conv_3.model.3.conv_dw.bn.running_mean", "model.conv_3.model.3.conv_dw.bn.running_var", "model.conv_3.model.3.conv_dw.bn.num_batches_tracked", "model.conv_3.model.3.conv_dw.prelu.weight", "model.conv_3.model.3.project.conv.weight", "model.conv_3.model.3.project.bn.weight", "model.conv_3.model.3.project.bn.bias", "model.conv_3.model.3.project.bn.running_mean", "model.conv_3.model.3.project.bn.running_var", "model.conv_3.model.3.project.bn.num_batches_tracked", "model.conv_3.model.3.se_module.fc1.weight", "model.conv_3.model.3.se_module.bn1.weight", "model.conv_3.model.3.se_module.bn1.bias", "model.conv_3.model.3.se_module.bn1.running_mean", "model.conv_3.model.3.se_module.bn1.running_var", "model.conv_3.model.3.se_module.bn1.num_batches_tracked", "model.conv_3.model.3.se_module.fc2.weight", "model.conv_3.model.3.se_module.bn2.weight", "model.conv_3.model.3.se_module.bn2.bias", "model.conv_3.model.3.se_module.bn2.running_mean", "model.conv_3.model.3.se_module.bn2.running_var", "model.conv_3.model.3.se_module.bn2.num_batches_tracked", "model.conv_34.conv.conv.weight", "model.conv_34.conv.bn.weight", "model.conv_34.conv.bn.bias", "model.conv_34.conv.bn.running_mean", "model.conv_34.conv.bn.running_var", "model.conv_34.conv.bn.num_batches_tracked", "model.conv_34.conv.prelu.weight", "model.conv_34.conv_dw.conv.weight", "model.conv_34.conv_dw.bn.weight", "model.conv_34.conv_dw.bn.bias", "model.conv_34.conv_dw.bn.running_mean", "model.conv_34.conv_dw.bn.running_var", "model.conv_34.conv_dw.bn.num_batches_tracked", "model.conv_34.conv_dw.prelu.weight", "model.conv_34.project.conv.weight", "model.conv_34.project.bn.weight", "model.conv_34.project.bn.bias", "model.conv_34.project.bn.running_mean", "model.conv_34.project.bn.running_var", "model.conv_34.project.bn.num_batches_tracked", "model.conv_4.model.0.conv.conv.weight", "model.conv_4.model.0.conv.bn.weight", "model.conv_4.model.0.conv.bn.bias", "model.conv_4.model.0.conv.bn.running_mean", "model.conv_4.model.0.conv.bn.running_var", "model.conv_4.model.0.conv.bn.num_batches_tracked", "model.conv_4.model.0.conv.prelu.weight", "model.conv_4.model.0.conv_dw.conv.weight", "model.conv_4.model.0.conv_dw.bn.weight", "model.conv_4.model.0.conv_dw.bn.bias", "model.conv_4.model.0.conv_dw.bn.running_mean", "model.conv_4.model.0.conv_dw.bn.running_var", "model.conv_4.model.0.conv_dw.bn.num_batches_tracked", "model.conv_4.model.0.conv_dw.prelu.weight", "model.conv_4.model.0.project.conv.weight", "model.conv_4.model.0.project.bn.weight", "model.conv_4.model.0.project.bn.bias", "model.conv_4.model.0.project.bn.running_mean", "model.conv_4.model.0.project.bn.running_var", "model.conv_4.model.0.project.bn.num_batches_tracked", "model.conv_4.model.1.conv.conv.weight", "model.conv_4.model.1.conv.bn.weight", "model.conv_4.model.1.conv.bn.bias", "model.conv_4.model.1.conv.bn.running_mean", "model.conv_4.model.1.conv.bn.running_var", "model.conv_4.model.1.conv.bn.num_batches_tracked", "model.conv_4.model.1.conv.prelu.weight", "model.conv_4.model.1.conv_dw.conv.weight", "model.conv_4.model.1.conv_dw.bn.weight", "model.conv_4.model.1.conv_dw.bn.bias", "model.conv_4.model.1.conv_dw.bn.running_mean", "model.conv_4.model.1.conv_dw.bn.running_var", "model.conv_4.model.1.conv_dw.bn.num_batches_tracked", "model.conv_4.model.1.conv_dw.prelu.weight", "model.conv_4.model.1.project.conv.weight", "model.conv_4.model.1.project.bn.weight", "model.conv_4.model.1.project.bn.bias", "model.conv_4.model.1.project.bn.running_mean", "model.conv_4.model.1.project.bn.running_var", "model.conv_4.model.1.project.bn.num_batches_tracked", "model.conv_4.model.2.conv.conv.weight", "model.conv_4.model.2.conv.bn.weight", "model.conv_4.model.2.conv.bn.bias", "model.conv_4.model.2.conv.bn.running_mean", "model.conv_4.model.2.conv.bn.running_var", "model.conv_4.model.2.conv.bn.num_batches_tracked", "model.conv_4.model.2.conv.prelu.weight", "model.conv_4.model.2.conv_dw.conv.weight", "model.conv_4.model.2.conv_dw.bn.weight", "model.conv_4.model.2.conv_dw.bn.bias", "model.conv_4.model.2.conv_dw.bn.running_mean", "model.conv_4.model.2.conv_dw.bn.running_var", "model.conv_4.model.2.conv_dw.bn.num_batches_tracked", "model.conv_4.model.2.conv_dw.prelu.weight", "model.conv_4.model.2.project.conv.weight", "model.conv_4.model.2.project.bn.weight", "model.conv_4.model.2.project.bn.bias", "model.conv_4.model.2.project.bn.running_mean", "model.conv_4.model.2.project.bn.running_var", "model.conv_4.model.2.project.bn.num_batches_tracked", "model.conv_4.model.3.conv.conv.weight", "model.conv_4.model.3.conv.bn.weight", "model.conv_4.model.3.conv.bn.bias", "model.conv_4.model.3.conv.bn.running_mean", "model.conv_4.model.3.conv.bn.running_var", "model.conv_4.model.3.conv.bn.num_batches_tracked", "model.conv_4.model.3.conv.prelu.weight", "model.conv_4.model.3.conv_dw.conv.weight", "model.conv_4.model.3.conv_dw.bn.weight", "model.conv_4.model.3.conv_dw.bn.bias", "model.conv_4.model.3.conv_dw.bn.running_mean", "model.conv_4.model.3.conv_dw.bn.running_var", "model.conv_4.model.3.conv_dw.bn.num_batches_tracked", "model.conv_4.model.3.conv_dw.prelu.weight", "model.conv_4.model.3.project.conv.weight", "model.conv_4.model.3.project.bn.weight", "model.conv_4.model.3.project.bn.bias", "model.conv_4.model.3.project.bn.running_mean", "model.conv_4.model.3.project.bn.running_var", "model.conv_4.model.3.project.bn.num_batches_tracked", "model.conv_4.model.4.conv.conv.weight", "model.conv_4.model.4.conv.bn.weight", "model.conv_4.model.4.conv.bn.bias", "model.conv_4.model.4.conv.bn.running_mean", "model.conv_4.model.4.conv.bn.running_var", "model.conv_4.model.4.conv.bn.num_batches_tracked", "model.conv_4.model.4.conv.prelu.weight", "model.conv_4.model.4.conv_dw.conv.weight", "model.conv_4.model.4.conv_dw.bn.weight", "model.conv_4.model.4.conv_dw.bn.bias", "model.conv_4.model.4.conv_dw.bn.running_mean", "model.conv_4.model.4.conv_dw.bn.running_var", "model.conv_4.model.4.conv_dw.bn.num_batches_tracked", "model.conv_4.model.4.conv_dw.prelu.weight", "model.conv_4.model.4.project.conv.weight", "model.conv_4.model.4.project.bn.weight", "model.conv_4.model.4.project.bn.bias", "model.conv_4.model.4.project.bn.running_mean", "model.conv_4.model.4.project.bn.running_var", "model.conv_4.model.4.project.bn.num_batches_tracked", "model.conv_4.model.5.conv.conv.weight", "model.conv_4.model.5.conv.bn.weight", "model.conv_4.model.5.conv.bn.bias", "model.conv_4.model.5.conv.bn.running_mean", "model.conv_4.model.5.conv.bn.running_var", "model.conv_4.model.5.conv.bn.num_batches_tracked", "model.conv_4.model.5.conv.prelu.weight", "model.conv_4.model.5.conv_dw.conv.weight", "model.conv_4.model.5.conv_dw.bn.weight", "model.conv_4.model.5.conv_dw.bn.bias", "model.conv_4.model.5.conv_dw.bn.running_mean", "model.conv_4.model.5.conv_dw.bn.running_var", "model.conv_4.model.5.conv_dw.bn.num_batches_tracked", "model.conv_4.model.5.conv_dw.prelu.weight", "model.conv_4.model.5.project.conv.weight", "model.conv_4.model.5.project.bn.weight", "model.conv_4.model.5.project.bn.bias", "model.conv_4.model.5.project.bn.running_mean", "model.conv_4.model.5.project.bn.running_var", "model.conv_4.model.5.project.bn.num_batches_tracked", "model.conv_4.model.5.se_module.fc1.weight", "model.conv_4.model.5.se_module.bn1.weight", "model.conv_4.model.5.se_module.bn1.bias", "model.conv_4.model.5.se_module.bn1.running_mean", "model.conv_4.model.5.se_module.bn1.running_var", "model.conv_4.model.5.se_module.bn1.num_batches_tracked", "model.conv_4.model.5.se_module.fc2.weight", "model.conv_4.model.5.se_module.bn2.weight", "model.conv_4.model.5.se_module.bn2.bias", "model.conv_4.model.5.se_module.bn2.running_mean", "model.conv_4.model.5.se_module.bn2.running_var", "model.conv_4.model.5.se_module.bn2.num_batches_tracked", "model.conv_45.conv.conv.weight", "model.conv_45.conv.bn.weight", "model.conv_45.conv.bn.bias", "model.conv_45.conv.bn.running_mean", "model.conv_45.conv.bn.running_var", "model.conv_45.conv.bn.num_batches_tracked", "model.conv_45.conv.prelu.weight", "model.conv_45.conv_dw.conv.weight", "model.conv_45.conv_dw.bn.weight", "model.conv_45.conv_dw.bn.bias", "model.conv_45.conv_dw.bn.running_mean", "model.conv_45.conv_dw.bn.running_var", "model.conv_45.conv_dw.bn.num_batches_tracked", "model.conv_45.conv_dw.prelu.weight", "model.conv_45.project.conv.weight", "model.conv_45.project.bn.weight", "model.conv_45.project.bn.bias", "model.conv_45.project.bn.running_mean", "model.conv_45.project.bn.running_var", "model.conv_45.project.bn.num_batches_tracked", "model.conv_5.model.0.conv.conv.weight", "model.conv_5.model.0.conv.bn.weight", "model.conv_5.model.0.conv.bn.bias", "model.conv_5.model.0.conv.bn.running_mean", "model.conv_5.model.0.conv.bn.running_var", "model.conv_5.model.0.conv.bn.num_batches_tracked", "model.conv_5.model.0.conv.prelu.weight", "model.conv_5.model.0.conv_dw.conv.weight", "model.conv_5.model.0.conv_dw.bn.weight", "model.conv_5.model.0.conv_dw.bn.bias", "model.conv_5.model.0.conv_dw.bn.running_mean", "model.conv_5.model.0.conv_dw.bn.running_var", "model.conv_5.model.0.conv_dw.bn.num_batches_tracked", "model.conv_5.model.0.conv_dw.prelu.weight", "model.conv_5.model.0.project.conv.weight", "model.conv_5.model.0.project.bn.weight", "model.conv_5.model.0.project.bn.bias", "model.conv_5.model.0.project.bn.running_mean", "model.conv_5.model.0.project.bn.running_var", "model.conv_5.model.0.project.bn.num_batches_tracked", "model.conv_5.model.1.conv.conv.weight", "model.conv_5.model.1.conv.bn.weight", "model.conv_5.model.1.conv.bn.bias", "model.conv_5.model.1.conv.bn.running_mean", "model.conv_5.model.1.conv.bn.running_var", "model.conv_5.model.1.conv.bn.num_batches_tracked", "model.conv_5.model.1.conv.prelu.weight", "model.conv_5.model.1.conv_dw.conv.weight", "model.conv_5.model.1.conv_dw.bn.weight", "model.conv_5.model.1.conv_dw.bn.bias", "model.conv_5.model.1.conv_dw.bn.running_mean", "model.conv_5.model.1.conv_dw.bn.running_var", "model.conv_5.model.1.conv_dw.bn.num_batches_tracked", "model.conv_5.model.1.conv_dw.prelu.weight", "model.conv_5.model.1.project.conv.weight", "model.conv_5.model.1.project.bn.weight", "model.conv_5.model.1.project.bn.bias", "model.conv_5.model.1.project.bn.running_mean", "model.conv_5.model.1.project.bn.running_var", "model.conv_5.model.1.project.bn.num_batches_tracked", "model.conv_5.model.1.se_module.fc1.weight", "model.conv_5.model.1.se_module.bn1.weight", "model.conv_5.model.1.se_module.bn1.bias", "model.conv_5.model.1.se_module.bn1.running_mean", "model.conv_5.model.1.se_module.bn1.running_var", "model.conv_5.model.1.se_module.bn1.num_batches_tracked", "model.conv_5.model.1.se_module.fc2.weight", "model.conv_5.model.1.se_module.bn2.weight", "model.conv_5.model.1.se_module.bn2.bias", "model.conv_5.model.1.se_module.bn2.running_mean", "model.conv_5.model.1.se_module.bn2.running_var", "model.conv_5.model.1.se_module.bn2.num_batches_tracked", "model.conv_6_sep.conv.weight", "model.conv_6_sep.bn.weight", "model.conv_6_sep.bn.bias", "model.conv_6_sep.bn.running_mean", "model.conv_6_sep.bn.running_var", "model.conv_6_sep.bn.num_batches_tracked", "model.conv_6_sep.prelu.weight", "model.conv_6_dw.conv.weight", "model.conv_6_dw.bn.weight", "model.conv_6_dw.bn.bias", "model.conv_6_dw.bn.running_mean", "model.conv_6_dw.bn.running_var", "model.conv_6_dw.bn.num_batches_tracked", "model.linear.weight", "model.bn.weight", "model.bn.bias", "model.bn.running_mean", "model.bn.running_var", "model.bn.num_batches_tracked", "model.prob.weight", "FTGenerator.ft.0.weight", "FTGenerator.ft.0.bias", "FTGenerator.ft.1.weight", "FTGenerator.ft.1.bias", "FTGenerator.ft.1.running_mean", "FTGenerator.ft.1.running_var", "FTGenerator.ft.1.num_batches_tracked", "FTGenerator.ft.3.weight", "FTGenerator.ft.3.bias", "FTGenerator.ft.4.weight", "FTGenerator.ft.4.bias", "FTGenerator.ft.4.running_mean", "FTGenerator.ft.4.running_var", "FTGenerator.ft.4.num_batches_tracked", "FTGenerator.ft.6.weight", "FTGenerator.ft.6.bias", "FTGenerator.ft.7.weight", "FTGenerator.ft.7.bias", "FTGenerator.ft.7.running_mean", "FTGenerator.ft.7.running_var", "FTGenerator.ft.7.num_batches_tracked".

What is the root cause of error?

Help me .
Thanks.

@hufangjian
Copy link

i get the same error.

@zhuyingSeu
Copy link
Member

1.We provide four model definitions.
2.You can define the num_classes according to your need.We define the 2D Fake Face as class 0, the True Face as class 1 and the 3D Fake Face as class 2.You can define Fake Face as class 0 and the True Face as class 1.
3.You can ingnore the org_1_80x60, because the size is related to the origin image.
4.You can name the model according to you rule.
5.When we test the model, we do not use the FTGenerator because it is only used to train the model.

@eliayakoumi
Copy link

I am getting the same error. after doing the training i am usingthe resulting 2020-12-03-17-48_Anti_Spoofing_2.7_80x80_model_iter-575.pth after renaming it to 2.7_80x80_MiniFASNetV2SE.pth (the same MiniFASNet use in default training code).
How did you solve this error?

@Klawens
Copy link

Klawens commented May 23, 2022

Same error, using MiniFASNetV2SE modified classes=2, got Missing key(s) in state_dict:

@AZ390
Copy link

AZ390 commented Aug 30, 2022

@bit2001 Hello
If you were kind enough and tell me, how did you solve this error, as I am facing the same error?

@Cj00W
Copy link

Cj00W commented Aug 17, 2023

by add some code in anti_spoof_predict.py and rename the pth file as follow, i have run my model successfully.
image
image

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

7 participants