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

FileNotFoundError: [Errno 2] No such file or directory: '' #8

Open
ws-choi opened this issue Mar 2, 2022 · 0 comments
Open

FileNotFoundError: [Errno 2] No such file or directory: '' #8

ws-choi opened this issue Mar 2, 2022 · 0 comments

Comments

@ws-choi
Copy link

ws-choi commented Mar 2, 2022

Hi, authors,
Thank you for open sourcing this great repository.

I ran python train.py --config config.yaml, and got this error: FileNotFoundError: [Errno 2] No such file or directory: ''

Traceback (most recent call last):
  File "/home/wschoi/PycharmProjects/WSRGlow/train.py", line 345, in <module>
    WaveGlowTask4.start()
  File "/home/wschoi/PycharmProjects/WSRGlow/train.py", line 274, in start
    period=1 if hparams['save_ckpt'] else 100000
  File "/home/wschoi/PycharmProjects/WSRGlow/training_utils.py", line 23, in __init__
    os.makedirs(filepath, exist_ok=True)
  File "/home/wschoi/miniconda3/envs/wsrglow/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

Process finished with exit code 1

I guess this error was occurred because args_work_dir was set to '' unless args.exp_name is not a default value.

WSRGlow/hparams.py

Lines 39 to 42 in 1b8fc49

args_work_dir = ''
if args.exp_name != '':
args.work_dir = args.exp_name
args_work_dir = f'checkpoints/{args.work_dir}'

and then, hparams_['work_dir'] is set to args_work_dir regardless of work_dir of config.yaml.

WSRGlow/hparams.py

Lines 84 to 86 in 1b8fc49

if not args.reset:
hparams_.update(saved_hparams)
hparams_['work_dir'] = args_work_dir


TLDR;

This error is occurred only when args.exp_name == '' .

For those who want to quickly reproduce train.py I would recommend a script like below.

python train.py --config config.yaml --config config.yaml --exp_name WSRGlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant