當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。