Maclory / Deep-Iterative-Collaboration

Pytorch implementation of Deep Face Super-Resolution with Iterative Collaboration between Attentive Recovery and Landmark Estimation (CVPR 2020)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem loading the model

ZeeRizvee opened this issue · comments

Greetings.

Thank you uploading this code and providing access to the pre-trained models too.
There seems to be some issue when I'm trying to load the pre-trained models. I'm trying to load the DICGAN CelebA model and test it on my own dataset. I tried loading the DICGAN Helen model too but the error is same. Can you kindly guide what I'm doing wrong here?

`===> Loading model from [../models/DICGAN_CelebA.pth]...

Traceback (most recent call last):

File "test.py", line 128, in
main()

File "test.py", line 43, in main
solver = create_solver(opt)

File "/home/zeeshan/codes/super_resolution_algorithms/Deep-Iterative-Collaboration/code/solvers/init.py", line 8, in create_solver
solver = SRLandmarkGANSolver(opt)

File "/home/zeeshan/codes/super_resolution_algorithms/Deep-Iterative-Collaboration/code/solvers/SRLandmarkGANSolver.py", line 113, in init
self.load()

File "/home/zeeshan/codes/super_resolution_algorithms/Deep-Iterative-Collaboration/code/solvers/SRLandmarkGANSolver.py", line 361, in load
res_str = _load_func(self.model, checkpoint)

File "/home/zeeshan/codes/super_resolution_algorithms/Deep-Iterative-Collaboration/code/solvers/SRLandmarkGANSolver.py", line 293, in _load_func
if len(res.missing_keys) != 0:

AttributeError: 'NoneType' object has no attribute 'missing_keys'
`

Hi, I guess you are using Pytorch < 1.1.0, because load_state_dict starts to have returns after Pytorch 1.1.0.

It's my fault that I specify Pytorch >= 1.0 in README, just updated to Pytorch >= 1.1.0.

Actually I was using Pytorch 1.2.0 when I run the experiment. So I suggest you switch to Pytorch 1.2.0.

Yes I was using Pytorch 1.0.0. Changing the Pytorch version resolved the issue. Cheers!