From b3134a99d0d369e82475c7f086bc38410bca67ae Mon Sep 17 00:00:00 2001 From: leno3003 Date: Tue, 29 Mar 2022 12:26:54 +0200 Subject: [PATCH] automatized arguments with pickle --- core/interact/interact_dict.py | 4 +++- mainscripts/Trainer.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/interact/interact_dict.py b/core/interact/interact_dict.py index ef82d1d..4635155 100644 --- a/core/interact/interact_dict.py +++ b/core/interact/interact_dict.py @@ -5,6 +5,8 @@ dictionary = { '[png] Output image format ( png/jpg ?:help ) : ' : 'png', 'Override' : '0', ' Press enter in 2 seconds to override model settings. ' : '\n', +'Enable pretraining mode' : 'n', +'Enable gradient clipping' : 'n', '[0] Which GPU indexes to choose? : ' : '0', '[wf] Face type ( f/wf/head ?:help ) : ' : 'wf', '[0] Max number of faces from image ( ?:help ) : ' : '0', @@ -14,7 +16,7 @@ dictionary = { '[y] Continue extraction? ( y/n ?:help ) : ' : 'True', '[2] Autobackup every N hour ( 0..24 ?:help ) : ' : '2', '[n] Write preview history ( y/n ?:help ) : ' : 'False', -'[83000] Target iteration : ' : '100000', +'[83000] Target iteration : ' : '110000', '[n] Flip SRC faces randomly ( y/n ?:help ) : ' : 'False', '[n] Flip DST faces randomly ( y/n ?:help ) : ' : 'False', '[4] Batch_size ( ?:help ) : ' : '4', diff --git a/mainscripts/Trainer.py b/mainscripts/Trainer.py index 54234a6..1b66348 100644 --- a/mainscripts/Trainer.py +++ b/mainscripts/Trainer.py @@ -84,6 +84,8 @@ def trainerThread (s2c, c2s, e, if model.get_target_iter() != 0: if is_reached_goal: io.log_info('Model already trained to target iteration. You can use preview.') + model_save() + os._exit(1) else: io.log_info('Starting. Target iteration: %d. Press "Enter" to stop training and save model.' % ( model.get_target_iter() ) ) else: @@ -163,7 +165,8 @@ def trainerThread (s2c, c2s, e, model_save() is_reached_goal = True io.log_info ('You can use preview now.') - exit(0) + model_save() + os._exit(1) need_save = False while time.time() - last_save_time >= save_interval_min*60: