boostcampaitech3 / level2-data-annotation_cv-level2-cv-15

level2-data-annotation_cv-level2-cv-15 created by GitHub Classroom
6 stars 1 forks source link

[Feat] Add model-load reslves #20 #21

Closed Lim-JH-Laskaris closed 2 years ago

Lim-JH-Laskaris commented 2 years ago

개요

작업사항

    #to load parameters
    parser.add_argument('--load', type=str, default = "F")

    def do_training(~~~, **load**):  

    ################################모델 불러오기 코드 #############################################
    if load != "F":
        if   load =="T": #####정균님 0.67 코드 불러오기 ######
            print('load parameter from /baseline_200_(ICDAR17_all).pth')
            model.load_state_dict(torch.load(model_dir+"/baseline_200_(ICDAR17_all).pth"))

        elif load =="L": ##### 학습하던 코드 불러오기(exp_name 그대로인 경우)#####
            print('load parameter from latest.pth')
            model.load_state_dict(torch.load(model_dir+f'/{exp_name}_latest.pth'))
        else :           ##### pth 지정하기 (단, 학습하던 모델 디렉터리에 존재해야함) #####
            print(f'load parameter {load}')
            model.load_state_dict(torch.load(model_dir+'/'+load)) 
    ############################################################################################

완료된 Task

resolved #20