Closed anse3832 closed 2 years ago
Hi,
Thanks for your attention to our work. You can avoid the code of load_net = load_net[param_key]
to load model. I will also update the function later. Thanks!
I think the code needs a pre-trained weight file as below, but I cannot get the file.
I think the code needs a pre-trained weight file as below, but I cannot get the file.
Hi,
This is the pretrained model of MSRResNet. Please get the file from the BasicSR project. Thanks.
As you said, I used the pretrained model of MSRResNet from BasicSR project (The link is https://drive.google.com/drive/folders/1XN4WXKJ53KQ0Cu0Yv-uCt8DZWq6uufaP) However, when I run the code, it shows an error as below.
Traceback (most recent call last):
File "./dasr/train.py", line 15, in
Maybe the weights name of MSRResNet (in BasicSR) is different from those of MSRResNetDynamic (in your repo).
Please show me your yml file and the command you run. Thanks. The code has been checked, and should work if you exactly follow our instructions.
when i using the net_g model they offered as pre-trained model i change the loading model code from "self.load_network_init_alldynamic" to "self.load_network"
@csjliang Here are the yml file and running code (sh file) I used. DASR.zip
@Lvhhhh When I used net_g model (instead of using MSRResNet in BasicSR), your suggestion is helpful. Thanks!
@csjliang Here are the yml file and running code (sh file) I used. DASR.zip
Please use the attached pre-trained model. Thanks. MSRResNet_x4_f64b16_DIV2K_1000k_B16G1_net_g_1000000.zip
@csjliang The error occurred because of my code modification. The problem is not related to the weight file. Anyway, it works well. Thanks!
Thanks.
I want to remind possible reproduce in the future that the function self.load_network_init_alldynamic
is still necessary if one want to train DASR as this paper did. Since the weight value of the 'net_g.pth' is NOT the same as init_weight in MSRResNet_x4_f64b16_DIV2K_1000k_B16G1_net_g_1000000.zip provided in BasicSR. net_g.pth
is used for testing only. So, one need to modify the yml file of number_networks
from 0 to 5, and then use the self.load_network_init_alldynamic
function to reproduce the training process of this paper.
I downloaded the pretrained models as you said, and the file name is "net_g.pth" and "net_p.pth", However, when I tried to load "net_g.pth" using train_DASR.yml, it shows an error as below.
Traceback (most recent call last): File "./dasr/train.py", line 15, in
train_pipeline(root_path)
File "/nas/workspace/anse/code/pytorch/SR/DASR/basicsr/train.py", line 128, in train_pipeline
model = build_model(opt)
File "/nas/workspace/anse/code/pytorch/SR/DASR/basicsr/models/init.py", line 27, in build_model
model = MODEL_REGISTRY.get(opt['model_type'])(opt)
File "/nas/workspace/anse/code/pytorch/SR/DASR/dasr/models/DASR_model.py", line 20, in init
super(DASRModel, self).init(opt)
File "/nas/workspace/anse/code/pytorch/SR/DASR/basicsr/models/srgan_dynamic_model.py", line 41, in init
self.load_network_init_alldynamic(self.net_g, load_path, self.opt['num_networks'], self.opt['path'].get('strict_load_g', True), load_key)
File "/nas/workspace/anse/code/pytorch/SR/DASR/basicsr/models/base_model.py", line 372, in load_network_init_alldynamic
load_net = load_net[param_key]
KeyError: 'params'
I think that the pretrained model weights (similar as dictionary?) has no key 'params'.
So, I add the key 'params', and this code shows another error.
![캡처](https://user-images.githubusercontent.com/77471764/161457913-169b0219-a935-4cdf-8382-4e9927be6d7e.PNG)
Could you tell me what the problem is?