KichangKim / DeepDanbooru

AI based multi-label girl image classification system, implemented by using TensorFlow.
MIT License
2.65k stars 260 forks source link

Fix cp1252 UnicodeEncodeError #88

Open NotRel opened 1 year ago

NotRel commented 1 year ago

Simple fix for the following UnicodeEncodeError error:

  File "..\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 25-26: character maps to <undefined>

The error occurs when running the script on a file path containing non-ASCII characters, such as Japanese.

To reproduce the error on Windows command line, run the following command:

python -m deepdanbooru evaluate --project-path ./deepdanbooru-v3-20211112-sgd-e28/ "h:\path to\image\やあ.png" >out