8
8
9
9
SAVEDMODEL_FILENAME = "saved_model.pb"
10
10
11
+
11
12
def is_savedmodel_written (args_list ):
12
13
out_savedmodel = "/tmp/savedmodel"
13
14
base_args = ["--logdir" , "/tmp/logdir" ,
@@ -25,51 +26,52 @@ def is_savedmodel_written(args_list):
25
26
26
27
27
28
OS2_TFREC_PTH = "baseline/TFRecord/CRGA"
28
- OS2_ALL_BANDS_TFREC_PTH = "/baseline/TFRecord/CRGA_all_bands"
29
- MERANER_ALL_BANDS_TFREC_PTH = "/baseline/TFRecord/CRGA_all_bands"
29
+ OS2_ALL_BANDS_TFREC_PTH = "baseline/TFRecord/CRGA_all_bands"
30
+ MERANER_ALL_BANDS_TFREC_PTH = "baseline/TFRecord/CRGA_all_bands"
31
+ ERRMSG = f"File { SAVEDMODEL_FILENAME } not found !"
30
32
31
33
32
34
class TrainFromTFRecordsTest (DecloudTest ):
33
35
34
36
def test_trainFromTFRecords_os1_unet (self ):
35
37
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_TFREC_PTH ),
36
38
"--model" , "crga_os1_unet" ]),
37
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
39
+ ERRMSG )
38
40
39
41
def test_trainFromTFRecords_os2_david (self ):
40
42
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_TFREC_PTH ),
41
43
"--model" , "crga_os2_david" ]),
42
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
44
+ ERRMSG )
43
45
44
46
def test_trainFromTFRecords_os2_unet (self ):
45
47
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_TFREC_PTH ),
46
48
"--model" , "crga_os2_unet" ]),
47
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
49
+ ERRMSG )
48
50
49
51
def test_trainFromTFRecords_os1_unet_all_bands (self ):
50
52
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_ALL_BANDS_TFREC_PTH ),
51
53
"--model" , "crga_os1_unet_all_bands" ]),
52
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
54
+ ERRMSG )
53
55
54
56
def test_trainFromTFRecords_os2_david_all_bands (self ):
55
57
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_ALL_BANDS_TFREC_PTH ),
56
58
"--model" , "crga_os2_david_all_bands" ]),
57
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
59
+ ERRMSG )
58
60
59
61
def test_trainFromTFRecords_os2_unet_all_bands (self ):
60
62
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (OS2_ALL_BANDS_TFREC_PTH ),
61
63
"--model" , "crga_os2_unet_all_bands" ]),
62
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
64
+ ERRMSG )
63
65
64
66
def test_trainFromTFRecords_meraner_unet (self ):
65
67
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (MERANER_ALL_BANDS_TFREC_PTH ),
66
68
"--model" , "meraner_unet" ]),
67
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
69
+ ERRMSG )
68
70
69
71
def test_trainFromTFRecords_meraner_unet_all_bands (self ):
70
72
self .assertTrue (is_savedmodel_written (["--training_record" , self .get_path (MERANER_ALL_BANDS_TFREC_PTH ),
71
73
"--model" , "meraner_unet_all_bands" ]),
72
- "File {} not found !" . format ( SAVEDMODEL_FILENAME ) )
74
+ ERRMSG )
73
75
74
76
75
77
if __name__ == '__main__' :
0 commit comments