提交 0ebf3a76 编写于 作者: L lywen

修正crnn cpu环境下加载模型权重错误

上级 7ed6f2ec
......@@ -21,7 +21,7 @@ def crnnSource():
else:
model = crnn.CRNN(32, 1, len(alphabet)+1, 256, 1).cpu()
state_dict = torch.load(ocrModel)
state_dict = torch.load(ocrModel,map_location=lambda storage, loc: storage)
new_state_dict = OrderedDict()
for k, v in state_dict.items():
name = k.replace('module.','') # remove `module.`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册