问题:
解决:
添加strict=False,允许加载过程中出现不匹配的键。但请注意,仍然需要确保模型中的主要参数能够正确加载,以确保模型的有效性。
model.load_state_dict(state_dict)
# 改为:
model.load_state_dict(state_dict, strict=False)
[chrome devtools]Sources面板
阅读 30
2023-10-17
问题:
解决:
添加strict=False,允许加载过程中出现不匹配的键。但请注意,仍然需要确保模型中的主要参数能够正确加载,以确保模型的有效性。
model.load_state_dict(state_dict)
# 改为:
model.load_state_dict(state_dict, strict=False)
相关推荐
精彩评论(0)