fix : _save_log 前确保日志目录存在,防止跨进程反序列化后目录丢失
This commit is contained in:
parent
445378667f
commit
daf627a6de
|
|
@ -271,6 +271,7 @@ class MetricLoggerCallback(TrainCallback):
|
|||
@only_on_rank(0)
|
||||
def _save_log(self, epoch, iter):
|
||||
log_file = self.log_dir / f"epoch_{epoch}_iter_{iter}_metric.jsonl"
|
||||
log_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with open(log_file, "w") as f:
|
||||
for log in self.log_cache:
|
||||
|
|
|
|||
Loading…
Reference in New Issue