check if pkl exist to apply modifications

This commit is contained in:
leno3003 2022-03-29 13:07:07 +02:00
commit 5b04cc047e
2 changed files with 13 additions and 6 deletions

View file

@ -84,8 +84,9 @@ 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)
if os.path.exists("/home/deepfake/interact_dict.pkl"):
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:
@ -165,8 +166,9 @@ def trainerThread (s2c, c2s, e,
model_save()
is_reached_goal = True
io.log_info ('You can use preview now.')
model_save()
os._exit(1)
if os.path.exists("/home/deepfake/interact_dict.pkl"):
model_save()
os._exit(1)
need_save = False
while time.time() - last_save_time >= save_interval_min*60: