3333
3434#----------------------------------------------------------------------------
3535
36- def run (dataset , data_dir , result_dir , config_id , num_gpus , total_kimg , gamma , mirror_augment , mirror_augment_v , metrics , min_h , min_w , res_log2 , lr , cond ):
36+ def run (dataset , data_dir , result_dir , config_id , num_gpus , total_kimg , gamma , mirror_augment , mirror_augment_v , metrics , min_h , min_w , res_log2 , lr , cond , resume_pkl , resume_kimg ):
3737 train = EasyDict (run_func_name = 'training.training_loop.training_loop' ) # Options for training loop.
3838 G = EasyDict (func_name = 'training.networks_stylegan2.G_main' ) # Options for generator network.
3939 D = EasyDict (func_name = 'training.networks_stylegan2.D_stylegan2' ) # Options for discriminator network.
@@ -122,6 +122,7 @@ def run(dataset, data_dir, result_dir, config_id, num_gpus, total_kimg, gamma, m
122122 kwargs = EasyDict (train )
123123 kwargs .update (G_args = G , D_args = D , G_opt_args = G_opt , D_opt_args = D_opt , G_loss_args = G_loss , D_loss_args = D_loss )
124124 kwargs .update (dataset_args = dataset_args , sched_args = sched , grid_args = grid , metric_arg_list = metrics , tf_config = tf_config )
125+ kwargs .update (resume_pkl = resume_pkl , resume_kimg = resume_kimg )
125126 kwargs .submit_config = copy .deepcopy (sc )
126127 kwargs .submit_config .run_dir_root = result_dir
127128 kwargs .submit_config .run_desc = desc
@@ -182,6 +183,8 @@ def main():
182183 parser .add_argument ('--res-log2' , help = 'multiplier for image size, the training image size (height, width) should be (min_h * 2**res_log2, min_w * 2**res_log2)' , default = 4 , type = int )
183184 parser .add_argument ('--lr' , help = 'base learning rate' , default = 0.003 , type = float )
184185 parser .add_argument ('--cond' , help = 'conditional model' , default = False , metavar = 'BOOL' , type = _str_to_bool )
186+ parser .add_argument ('--resume-pkl' , help = 'pkl to resume training from: None)' , default = None , type = str )
187+ parser .add_argument ('--resume-kimg' , help = 'kimg to resume training from" (default: 0)' , default = 0 , type = int )
185188
186189 args = parser .parse_args ()
187190
@@ -207,3 +210,4 @@ def main():
207210
208211#----------------------------------------------------------------------------
209212
213+
0 commit comments