Restore gc and emptycache when training

This commit is contained in:
litagin02
2024-02-05 16:02:16 +09:00
parent 48e24c020b
commit b0bb147d44
3 changed files with 10 additions and 6 deletions

View File

@@ -302,7 +302,7 @@ def train(model_name, skip_style=False, use_jp_extra=True):
cmd = [train_py, "--config", config_path, "--model", dataset_path]
if skip_style:
cmd.append("--skip_default_style")
success, message = run_script_with_log(cmd)
success, message = run_script_with_log(cmd, ignore_warning=True)
if not success:
logger.error(f"Train failed.")
return False, f"Error: 学習に失敗しました:\n{message}"