Fix: colab resuming training folder name bug
This commit is contained in:
@@ -252,9 +252,18 @@
|
|||||||
"# 上でつけたモデル名を入力。学習を途中からする場合はきちんとモデルが保存されているフォルダ名を入力。\n",
|
"# 上でつけたモデル名を入力。学習を途中からする場合はきちんとモデルが保存されているフォルダ名を入力。\n",
|
||||||
"model_name = \"your_model_name\"\n",
|
"model_name = \"your_model_name\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"import yaml\n",
|
||||||
"from webui_train import get_path\n",
|
"from webui_train import get_path\n",
|
||||||
"\n",
|
"\n",
|
||||||
"dataset_path, _, _, _, config_path = get_path(model_name)\n",
|
"dataset_path, _, _, _, config_path = get_path(model_name)\n",
|
||||||
|
"with open(\"default_config.yml\", \"r\", encoding=\"utf-8\") as f:\n",
|
||||||
|
" yml_data = yaml.safe_load(f)\n",
|
||||||
|
"yml_data[\"model_name\"] = model_name\n",
|
||||||
|
"yml_data[\"dataset_path\"] = dataset_path\n",
|
||||||
|
"with open(\"config.yml\", \"w\", encoding=\"utf-8\") as f:\n",
|
||||||
|
" yaml.dump(yml_data, f, allow_unicode=True)\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
"!python train_ms.py --config {config_path} --model {dataset_path}"
|
"!python train_ms.py --config {config_path} --model {dataset_path}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user