프로젝트

일반

사용자정보

개정판 77f7b6b3

ID77f7b6b3f86469c3b9fc45bc41fef2c1cce922e2
상위 f500705a
하위 39bfc930

함의성이(가) 4년 이상 전에 추가함

issue #1366: server change save checkpoint

차이점 보기:

DTI_PID/WebServer/symbol_recognition/src/yolo_doftech.py
9 9
    def __init__(self, pre_model, num_classes,
10 10
                 anchors=[(1.3221, 1.73145), (3.19275, 4.00944), (5.05587, 8.09892), (9.47112, 4.84053),
11 11
                          (11.2364, 10.0071)]):
12
                 #anchors=[(0.7, 3.0), (3.0, 0.7), (1.3, 8.0), (8.0, 1.3), (3.0, 6.4), (6.4, 3.0), (6, 6), (1.5, 3.0), (3.0, 1.5)]):
12 13
        super(YoloD, self).__init__()
13 14

  
14 15

  
DTI_PID/WebServer/symbol_recognition/src/yolo_net.py
9 9
    def __init__(self, num_classes,
10 10
                 anchors=[(1.3221, 1.73145), (3.19275, 4.00944), (5.05587, 8.09892), (9.47112, 4.84053),
11 11
                          (11.2364, 10.0071)]):
12
                 #anchors=[(0.7, 3.0), (3.0, 0.7), (1.3, 8.0), (8.0, 1.3), (3.0, 6.4), (6.4, 3.0), (6, 6), (1.5, 3.0), (3.0, 1.5)]):
12 13
        super(Yolo, self).__init__()
13 14
        self.num_classes = num_classes
14 15
        self.anchors = anchors
DTI_PID/WebServer/symbol_training/src/yolo_doftech.py
9 9
    def __init__(self, pre_model, num_classes,
10 10
                 anchors=[(1.3221, 1.73145), (3.19275, 4.00944), (5.05587, 8.09892), (9.47112, 4.84053),
11 11
                          (11.2364, 10.0071)]):
12
                 #anchors=[(0.7, 3.0), (3.0, 0.7), (1.3, 8.0), (8.0, 1.3), (3.0, 6.4), (6.4, 3.0), (4.5, 4.5), (1.5, 3.0), (3.0, 1.5)]):
12 13
        super(YoloD, self).__init__()
13 14

  
14 15
        self.num_classes = num_classes
DTI_PID/WebServer/symbol_training/train.py
44 44
    parser.add_argument("--decay", type=float, default=0.0005)
45 45
    parser.add_argument("--dropout", type=float, default=0.5)
46 46
    parser.add_argument("--num_epoches", type=int, default=205)
47
    parser.add_argument("--test_interval", type=int, default=20, help="Number of epoches between testing phases")
47
    parser.add_argument("--test_interval", type=int, default=10, help="Number of epoches between testing phases")
48 48
    parser.add_argument("--object_scale", type=float, default=1.0)
49 49
    parser.add_argument("--noobject_scale", type=float, default=0.5)
50 50
    parser.add_argument("--class_scale", type=float, default=1.0)
......
207 207
                # save
208 208
                torch.save(model.state_dict(), os.path.join(opt.saved_path, name + "_only_params.pth"))
209 209
                torch.save(model, os.path.join(opt.saved_path, name + "_whole_model.pth"))
210
            else:
211
                save_count += 1
212
                # for debug for each loss
213
                torch.save(model.state_dict(), os.path.join(opt.saved_path, name + "_only_params_" + str(save_count) + "_" + "{:.5f}".format(te_loss) + ".pth"))
214
                torch.save(model, os.path.join(opt.saved_path, name + "_whole_model_" + str(save_count) + "_" + "{:.5f}".format(te_loss) + ".pth"))
210 215

  
211 216
            # Early stopping
212 217
            if epoch - best_epoch > opt.es_patience > 0:

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)