vishal3477 / Reverse_Engineering_GMs

Official Pytorch implementation of paper "Reverse Engineering of Generative Models: Inferring Model Hyperparameters from Generated Images"
132 stars 18 forks source link

loaded state dict contains a parameter group that doesn't match the size of optimizer's group #3

Closed Huang-yihao closed 2 years ago

Huang-yihao commented 3 years ago

Hello, I have met a problem (as in the picture below) when executing the file "reverse_eng_test.py" loading the model "11_model_set_1.pickle". Could you please tell me what does the error mean? Because I am not familiar with the architecture of the model and the given pre-trained model "11_model_set_1.pickle". Upon the error is the output of the code ( print(state1['optimizer_1']) ) added by me to see the state of the "state1['optimizer_1']". Thank you!

image

vishal3477 commented 3 years ago

I think there is something wrong here. Can you paste the code snippet, what all you changed in code and what pretrained model you are using?

Huang-yihao commented 3 years ago

Thanks for your response. Below is the image (left is the original code, right is the changed code).

image

The model used by me is from this folder. image

Could you please point out the error? Thank you very much!

vishal3477 commented 3 years ago

Hi, I have made some changes in the code for fen.py in models directory. The issue is solved. Please try with the new code and let me know if any problem comes.

Huang-yihao commented 2 years ago

Hi, thanks for your response. Sorry for reply so late. I have been really busy these days and I will try it as soon as possible.

ssablak commented 2 years ago

@vishal3477 Hi Vishal, this error is still persisted. could you please either provide a correct model or fixing the source code?

vishal3477 commented 2 years ago

Did you try the recent commit? You can change the following line while defining the encoder: image

Hope this helps.

ssablak commented 2 years ago

@vishal3477 reverse_eng_test.py is running, but I have this error in deepfake_detection_test.py

Are you recommending to change in deepfake_detection_test?

model_2=encoder_deepfake.encoder(num_hidden=512).to(device)
ssablak commented 2 years ago

@vishal3477 I am trying to use the following model

parser.add_argument('--model_dir', default='./models/deepfake/uadfv/0_64000_model_30.pickle')

Actually, it gives the same error for all pre-trained deepfake models #10

vishal3477 commented 2 years ago

Can you use the newer version of deepfake code?