Error(s) in loading state_dict for FDGAN
Opened this issue · 4 comments
anothersin commented
WeilanAnnn commented
Please check your version of PyTorch(it should be 0.30 version) again.
…------------------ 原始邮件 ------------------
发件人: "WeilanAnnn/FD-GAN" <notifications@github.com>;
发送时间: 2020年11月11日(星期三) 下午4:19
收件人: "WeilanAnnn/FD-GAN"<FD-GAN@noreply.github.com>;
抄送: "Subscribed"<subscribed@noreply.github.com>;
主题: [WeilanAnnn/FD-GAN] Error(s) in loading state_dict for FDGAN (#7)
When load model you provided , the error raises. It seems that code don't load dense121 model.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
PINTO0309 commented
I made the following changes and it loaded successfully. Operation has not been verified.
- PyTorch 1.10.0
- netG_epoch_real.pth
# create new OrderedDict that does not contain `module.`
from collections import OrderedDict
new_state_dict = OrderedDict()
for k, v in state_dict.items():
name = k[7:] # remove `module.`
# ==========================================
name = name.replace('.norm.1.', '.norm1.')
name = name.replace('.norm.2.', '.norm2.')
name = name.replace('.conv.1.', '.conv1.')
name = name.replace('.conv.2.', '.conv2.')
# ==========================================
new_state_dict[name] = v
# load params
netG.load_state_dict(new_state_dict)
WeilanAnnn commented
The version of PyTorch should be 0.3.
发自我的iPhone
… 在 2022年3月19日,16:16,Katsuya Hyodo ***@***.***> 写道:
I made the following changes and it loaded successfully. Operation has not been verified.
PyTorch 1.10.0
netG_epoch_real.pth
# create new OrderedDict that does not contain `module.`
from collections import OrderedDict
new_state_dict = OrderedDict()
for k, v in state_dict.items():
name = k[7:] # remove `module.`
# ==========================================
name = name.replace('.norm.1.', '.norm1.')
name = name.replace('.norm.2.', '.norm2.')
name = name.replace('.conv.1.', '.conv1.')
name = name.replace('.conv.2.', '.conv2.')
# ==========================================
new_state_dict[name] = v
# load params
netG.load_state_dict(new_state_dict)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
odedeveloper commented
@PINTO0309 hey can you tell me the source code changes needed for this repo to run. I tried on my machine but was unable to get clean-haze free images.