模型检查

This commit is contained in:
2023-03-02 02:05:40 +08:00
parent 304266fc27
commit 75274a9015

View File

@@ -268,6 +268,12 @@ def main_dev(opt):
opt.ckpt = f'/data/ckpt/{model_name}.ckpt'
opt.device = 'cuda'
# 检查模型文件是否存在
if not os.path.exists(opt.ckpt):
print(f"模型文件不存在: {opt.ckpt}, 结束此任务")
update_task_status(task, "error", 0)
continue
# 检查yaml文件是否存在
if not os.path.exists(opt.config):
print(f"yaml文件不存在: {opt.config}, 将使用默认配置")