当前位置: 首页>>代码示例>>Python>>正文


Python load_model.load_checkpoint方法代码示例

本文整理汇总了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) 
开发者ID:tonysy,项目名称:Deep-Feature-Flow-Segmentation,代码行数:20,代码来源:combine_model.py

示例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) 
开发者ID:tech-quantum,项目名称:sia-cog,代码行数:20,代码来源:combine_model.py


注:本文中的load_model.load_checkpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。