Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of ddp #174

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions wetts/vits/utils/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import logging
import os
from pathlib import Path

import torch

Expand Down Expand Up @@ -189,9 +190,7 @@ def get_hparams(init=True):

args = parser.parse_args()
model_dir = args.model

if not os.path.exists(model_dir):
os.makedirs(model_dir)
Path(model_dir).mkdir(parents=True, exist_ok=True)

config_path = args.config
config_save_path = os.path.join(model_dir, "config.json")
Expand Down Expand Up @@ -247,8 +246,7 @@ def get_logger(model_dir, filename="train.log"):

formatter = logging.Formatter(
"%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s")
if not os.path.exists(model_dir):
os.makedirs(model_dir)
Path(model_dir).mkdir(parents=True, exist_ok=True)
h = logging.FileHandler(os.path.join(model_dir, filename))
h.setLevel(logging.INFO)
h.setFormatter(formatter)
Expand Down
Loading