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 train and generate directories getting created #374

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def main():
args = get_arguments()
started_datestring = "{0:%Y-%m-%dT%H-%M-%S}".format(datetime.now())
logdir = os.path.join(args.logdir, 'generate', started_datestring)
if not os.path.exists(logdir):
os.makedirs(logdir)
with open(args.wavenet_params, 'r') as config_file:
wavenet_params = json.load(config_file)

Expand Down
5 changes: 2 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ def save(saver, sess, logdir, step):
print('Storing checkpoint to {} ...'.format(logdir), end="")
sys.stdout.flush()

if not os.path.exists(logdir):
os.makedirs(logdir)

saver.save(sess, checkpoint_path, global_step=step)
print(' Done.')

Expand Down Expand Up @@ -171,6 +168,8 @@ def validate_directories(args):
if logdir is None:
logdir = get_default_logdir(logdir_root)
print('Using default logdir: {}'.format(logdir))
if not os.path.exists(logdir):
os.makedirs(logdir)

restore_from = args.restore_from
if restore_from is None:
Expand Down