本文整理汇总了Python中load_model.load_checkpoint方法的典型用法代码示例。如果您正苦于以下问题:Python load_model.load_checkpoint方法的具体用法?Python load_model.load_checkpoint怎么用?Python load_model.load_checkpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类load_model
的用法示例。
在下文中一共展示了load_model.load_checkpoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: combine_model
# 需要导入模块: import load_model [as 别名]
# 或者: from load_model import load_checkpoint [as 别名]
def combine_model(prefix1, epoch1, prefix2, epoch2, prefix_out, epoch_out):
args1, auxs1 = load_checkpoint(prefix1, epoch1)
args2, auxs2 = load_checkpoint(prefix2, epoch2)
arg_names = args1.keys() + args2.keys()
aux_names = auxs1.keys() + auxs2.keys()
args = dict()
for arg in arg_names:
if arg in args1:
args[arg] = args1[arg]
if arg in args2:
args[arg] = args2[arg]
auxs = dict()
for aux in aux_names:
if aux in auxs1:
auxs[aux] = auxs1[aux]
if aux in auxs2:
auxs[aux] = auxs2[aux]
save_checkpoint(prefix_out, epoch_out, args, auxs)
示例2: combine_model
# 需要导入模块: import load_model [as 别名]
# 或者: from load_model import load_checkpoint [as 别名]
def combine_model(prefix1, epoch1, prefix2, epoch2, prefix_out, epoch_out):
args1, auxs1 = load_checkpoint(prefix1, epoch1)
args2, auxs2 = load_checkpoint(prefix2, epoch2)
arg_names = args1.keys() + args2.keys()
aux_names = auxs1.keys() + auxs2.keys()
args = dict()
for arg in arg_names:
if arg in args1:
args[arg] = args1[arg]
else:
args[arg] = args2[arg]
auxs = dict()
for aux in aux_names:
if aux in auxs1:
auxs[aux] = auxs1[aux]
else:
auxs[aux] = auxs2[aux]
save_checkpoint(prefix_out, epoch_out, args, auxs)