zi2zi icon indicating copy to clipboard operation
zi2zi copied to clipboard

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

Open H-xie opened this issue 6 years ago • 2 comments

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.

H-xie avatar May 26 '18 03:05 H-xie

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

qiuxiaqing avatar Jul 31 '19 03:07 qiuxiaqing

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

not-bald-owl avatar Mar 29 '24 13:03 not-bald-owl