xhuangcv / hdr-nerf

The official implementation of CVPR 2022 paper: HDR-NeRF: High Dynamic Range Neural Radiance Fields
MIT License
196 stars 13 forks source link

Bug from you recently added code warm_crf #24

Open HarukiZhang opened 1 month ago

HarukiZhang commented 1 month ago

Try to run your code for trainning on your dataset. When code goes to warm_crf, error occurred: Generator type has no operator "+";

While, you just add with "+" model.exps_linears_r.parameters() + model.exps_linears_g.parameters();

But nn.Module.parameters() method returns a iterator of parameters.

I guess you were going to apend all parameters into a list and pass to optimizer.

So, you probably should write it like:

params_to_train = [
    {'params':model.exps_linears_r.parameters()},
    {'params':model.exps_linears_g.parameters()},
    {'params':model.exps_linears_b.parameters()},
    {'params':model.r_l_linner.parameters()},
    {'params':model.g_l_linner.parameters()},
    {'params':model.b_l_linner.parameters()},
]
optimizer_crf = torch.optim.Adam(params_to_train, lr=5e-4)

Please let me know if I was thinking wrong.

xhuangcv commented 1 month ago

Hi, I'll fix the bug. However, I currently don't have access to a testing device. If you encounter any other issues, please inform me. Thanks a lot!