Facial_Details_Synthesis icon indicating copy to clipboard operation
Facial_Details_Synthesis copied to clipboard

Model loading error while running facialDetails.py

Open XYWang-coder opened this issue 4 years ago • 1 comments

I'm sorry to distrubing you. There is an error when I running facialDetails.py I wonder if it's related to the version of pytorch which I use is 0.4.0 with cuda91. Here is the error

Traceback (most recent call last): File "facialDetails.py", line 307, in main(args) File "facialDetails.py", line 233, in main DFDN = {'forehead': create_model(args)} File "F:\pycharmProgram\released_v0.1\DFDN\models\models.py", line 10, in create_model model.initialize(opt) File "F:\pycharmProgram\released_v0.1\DFDN\models\pix2pix_model.py", line 79, in initialize self.load_network(self.netG, 'G', opt.which_epoch) File "F:\pycharmProgram\released_v0.1\DFDN\models\base_model.py", line 53, in load_network network.load_state_dict(torch.load(save_path)) File "D:\Anaconda3\envs\py3.6\lib\site-packages\torch\nn\modules\module.py", line 721, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for UnetGenerator: Unexpected key(s) in state_dict: "model.model.1.model.2.num_batches_tracked", "model.model.1.model.3.model.2.num_batches_tracked", "model.model.1.model.3.model.3.model.2.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.2.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.3.model.2.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.3.model.3.model.2.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.3.model.3.model.3.model.4.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.3.model.3.model.6.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.3.model.6.num_batches_tracked", "model.model.1.model.3.model.3.model.3.model.6.num_batches_tracked", "model.model.1.model.3.model.3.model.6.num_batches_tracked", "model.model.1.model.3.model.6.num_batches_tracked", "model.model.1.model.6.num_batches_tracked".

Waiting for your answer, thank you

XYWang-coder avatar Oct 19 '19 09:10 XYWang-coder

It looks like inconsistent between checkpoint and models, I think you may need try to update your pytorch to a newer verison(e.g. >=1.0). Thanks.

apchenstu avatar Oct 23 '19 13:10 apchenstu