Skip to content
New issue

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

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

Already on GitHub? # to your account

Test model problem #12

Open
wenfan-wenfan opened this issue May 2, 2020 · 2 comments
Open

Test model problem #12

wenfan-wenfan opened this issue May 2, 2020 · 2 comments

Comments

@wenfan-wenfan
Copy link

Dear Mr. Author@cszn, the work of DPSR is of great significance and gives me great inspiration. when I fully followed the requirements of your training environment and used the "main_train_dpsr.py" provided by you to train the model, I put the generated model into the "main_test_dpsr.py", but reported the following Error:
RuntimeError: Error(s) in loading state_dict for SRResNet:
Missing key(s) in state_dict: "model.2. Weight ", "model.2. Bias ", "model.5. Weight ", "model.5.
Unexpected key(s) in state_dict: "model.3. Weight ", "model.3. Bias ", "model.6. Weight ", "model

When I use your trained "dpsr_x2.pth","dpsr_x3.pth" and "dpsr_x4.pth" to check, but there is no problem, I have tried many ways in the inquiry and failed to solve, Do you have any good suggestion or solutions to my problem

this is the error picture:phttps://imgchr.com/i/JjAZVK

@cszn
Copy link
Owner

cszn commented May 2, 2020

You should also change

class SRResNet(nn.Module):

@wenfan-wenfan
Copy link
Author

You should also change

class SRResNet(nn.Module):

I'm sorry to disturb you again. Today, I changed “class SRResNet (nn.Module): ” in network_srresnet.py to network_dpsr.py as you suggested, but I still reported an error. In addition, I still followed the practice of many people on the Internet to add
model = nn.DataParallel(model)
in front of
model.load_state_dict(torch.load(model_path), strict=False)

, but there is still no correct result, so could you please tell me a detailed solution to this problem?Once again, I would like to express my heartfelt thanks to you!

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

No branches or pull requests

2 participants