You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if name == "main":
vocabulary = joblib.load(LABEL_PATH)
vocabulary = "".join(vocabulary)
model = GatedConv(vocabulary)
pretrained = torch.load("pretrained/model_49.pth")
pretrain_dict = pretrained.state_dict()
new_state_dict = OrderedDict()
for k, v in pretrain_dict.items():
name = k[7:]
new_state_dict[name] = v
model = model.load_state_dict(new_state_dict)
model = nn.DataParallel(model)
model.cuda()
train(model)
`
这是我的代码,加载完模型字典后模型参数都丢失了
The text was updated successfully, but these errors were encountered:
`
if name == "main":
vocabulary = joblib.load(LABEL_PATH)
vocabulary = "".join(vocabulary)
model = GatedConv(vocabulary)
pretrained = torch.load("pretrained/model_49.pth")
pretrain_dict = pretrained.state_dict()
new_state_dict = OrderedDict()
for k, v in pretrain_dict.items():
name = k[7:]
new_state_dict[name] = v
model = model.load_state_dict(new_state_dict)
model = nn.DataParallel(model)
model.cuda()
train(model)
`
这是我的代码,加载完模型字典后模型参数都丢失了
The text was updated successfully, but these errors were encountered: