kaonashi-tyc / zi2zi

Learning Chinese Character style with conditional GAN
https://kaonashi-tyc.github.io/2017/04/06/zi2zi.html
Apache License 2.0
2.54k stars 474 forks source link

IOError: [Errno 2] No such file or directory: 'dir/0_0000.jpg' #49

Open H-xie opened 6 years ago

H-xie commented 6 years ago

This is a SOLVED problem.

When running the preprocess command

python font2img.py --src_font=src.ttf
                   --dst_font=tgt.otf
                   --charset=CN 
                   --sample_count=1000
                   --sample_dir=dir
                   --label=0
                   --filter=1
                   --shuffle=1

An error occurred as title, which informs that the file is not exist by the code [line 87 | font2img.py] e.save(os.path.join(sample_dir, "%d_%04d.jpg" % (label, count)))

This is not a bug of PIL(pillow). It is coursed by the command. If the sample_dir is not exits, the program will through an error rather than create the sample_dir.

In conclusion, BEFORE run the preprocess command, sample_dir should be mkdir MANUALLY.

qiuxiaqing commented 5 years ago

In the options, there are a '--sample_dir=dir'. That is mean, you must mkdir a directory, which named "dir".

not-bald-owl commented 7 months ago

对的 在当前目录中先执行 mkdir dir