Rethinking-Inpainting-MEDFE icon indicating copy to clipboard operation
Rethinking-Inpainting-MEDFE copied to clipboard

自己训练的模型,无法test,在用continue_train时出现问题

Open GuoJingWeng opened this issue 3 years ago • 14 comments

test时,对于模型的加载出现问题 image

continue_train时,在MEDFN.py中没有引用load_network出现error image

GuoJingWeng avatar Nov 05 '20 12:11 GuoJingWeng

Maybe you can modify the code as follows, it works for me.

model.netEN.module.load_state_dict(torch.load("EN.pth")['net'])
model.netDE.module.load_state_dict(torch.load("DE.pth")['net'])
model.netMEDFE.module.load_state_dict(torch.load("MEDFE.pth")['net'])

xiefan-guo avatar Nov 07 '20 03:11 xiefan-guo

I change the code and it is correct now

KumapowerLIU avatar Nov 07 '20 14:11 KumapowerLIU

Maybe you can modify the code as follows, it works for me.

model.netEN.module.load_state_dict(torch.load("EN.pth")['net'])
model.netDE.module.load_state_dict(torch.load("DE.pth")['net'])
model.netMEDFE.module.load_state_dict(torch.load("MEDFE.pth")['net'])

Thank you very much. It's working properly

GuoJingWeng avatar Nov 08 '20 01:11 GuoJingWeng

我更改了代码,现在是正确的 Thank you very much. Your perfect work has greatly promoted my work

GuoJingWeng avatar Nov 08 '20 01:11 GuoJingWeng

您好,我最近也在复现这个代码,但是遇到一些问题,可以和您交流一下吗

ZHANG-hengzhi avatar May 07 '21 08:05 ZHANG-hengzhi

您好,我更改了opt里面的参数,但是为什么每次加载opt都会恢复最初始的值

ZHANG-hengzhi avatar May 07 '21 08:05 ZHANG-hengzhi

我在训练自己的代码时会报错AttributeError: 'Tensor' object has no attribute 'bool' image 请问是什么原因啊,非常感谢

ZHANG-hengzhi avatar May 08 '21 10:05 ZHANG-hengzhi

请问测试的时候不是应该只需要MASK吗,为什么test,py里三种图都用了

fxcdl avatar Jul 21 '21 07:07 fxcdl

他只是方便了数据加载,其实你看那部分源码就是只用了mask和原始图像的数据

---原始邮件--- 发件人: @.> 发送时间: 2021年7月21日(周三) 下午3:20 收件人: @.>; 抄送: @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问测试的时候不是应该只需要MASK吗,为什么test,py里三种图都用了

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

GuoJingWeng avatar Jul 21 '21 07:07 GuoJingWeng

请问为什么还要用原始图像,直接输入MASK不就应该能得到去遮挡的图吗

------------------ 原始邮件 ------------------ 发件人: "KumapowerLIU/Rethinking-Inpainting-MEDFE" @.>; 发送时间: 2021年7月21日(星期三) 下午3:30 @.>; @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

他只是方便了数据加载,其实你看那部分源码就是只用了mask和原始图像的数据

---原始邮件--- 发件人: @.> 发送时间: 2021年7月21日(周三) 下午3:20 收件人: @.>; 抄送: @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问测试的时候不是应该只需要MASK吗,为什么test,py里三种图都用了

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

fxcdl avatar Jul 21 '21 07:07 fxcdl

我说的原始图像就是待修复图像,mask是黑白图像,白色区域是标注的区域

---原始邮件--- 发件人: @.> 发送时间: 2021年7月21日(周三) 下午3:32 收件人: @.>; 抄送: @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问为什么还要用原始图像,直接输入MASK不就应该能得到去遮挡的图吗

------------------ 原始邮件 ------------------ 发件人: "KumapowerLIU/Rethinking-Inpainting-MEDFE" @.>; 发送时间: 2021年7月21日(星期三) 下午3:30 @.>; @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

他只是方便了数据加载,其实你看那部分源码就是只用了mask和原始图像的数据

---原始邮件---
发件人: @.>
发送时间: 2021年7月21日(周三) 下午3:20
收件人: @.
>;
抄送: @.@.>;
主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问测试的时候不是应该只需要MASK吗,为什么test,py里三种图都用了


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

GuoJingWeng avatar Jul 21 '21 07:07 GuoJingWeng

明白了,是我弄错了,万分感谢!!!

------------------ 原始邮件 ------------------ 发件人: "KumapowerLIU/Rethinking-Inpainting-MEDFE" @.>; 发送时间: 2021年7月21日(星期三) 下午3:43 @.>; @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

我说的原始图像就是待修复图像,mask是黑白图像,白色区域是标注的区域

---原始邮件--- 发件人: @.> 发送时间: 2021年7月21日(周三) 下午3:32 收件人: @.>; 抄送: @.@.>; 主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问为什么还要用原始图像,直接输入MASK不就应该能得到去遮挡的图吗

------------------ 原始邮件 ------------------
发件人: "KumapowerLIU/Rethinking-Inpainting-MEDFE" @.>;
发送时间: 2021年7月21日(星期三) 下午3:30
@.
>;
@.@.>;
主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

他只是方便了数据加载,其实你看那部分源码就是只用了mask和原始图像的数据

---原始邮件---
发件人: @.>
发送时间: 2021年7月21日(周三) 下午3:20
收件人: @.
>;
抄送: @.@.>;
主题: Re: [KumapowerLIU/Rethinking-Inpainting-MEDFE] 自己训练的模型,无法test,在用continue_train时出现问题 (#12)

请问测试的时候不是应该只需要MASK吗,为什么test,py里三种图都用了


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

fxcdl avatar Jul 21 '21 07:07 fxcdl

@GuoJingWeng @fxcdl 你们好,我也对这里输出结果的获取有些疑问,在test.py里还是用到了detail图像,也就是gt图像: fake_out = fake_out.detach().cpu() * mask + detail*(1-mask) 这里要怎么解释?

lh-13 avatar Jun 30 '22 07:06 lh-13