DPSR icon indicating copy to clipboard operation
DPSR copied to clipboard

Test model problem

Open wenfan-wenfan opened this issue 4 years ago • 2 comments

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

wenfan-wenfan avatar May 02 '20 00:05 wenfan-wenfan

You should also change https://github.com/cszn/DPSR/blob/2ec93c7178f8b03a7a3390f058acd8d7a849b0a6/models/network_srresnet.py#L13

cszn avatar May 02 '20 14:05 cszn

You should also change

https://github.com/cszn/DPSR/blob/2ec93c7178f8b03a7a3390f058acd8d7a849b0a6/models/network_srresnet.py#L13

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!

wenfan-wenfan avatar May 03 '20 08:05 wenfan-wenfan