zkx06111/WSRGlow

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

ws-choi opened this issue · 0 comments

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