Labelimg: in generateColorByText: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

Created on 10 Sep 2018  路  6Comments  路  Source: tzutalin/labelImg

Thanks for sharing this useful tool 馃憤
I have some Chinese names in the file "predefined_classes.txt".
At first, I just open "predefined_classes.txt" with Windows' notepad and type in the names, but I got the errors as below:
1
then I save the "predefined_classes.txt" with UTF-8 encoding. The app opened successfully, then I began to label the objects, I draw a box and the Chinese name list popup as it should be, but when I select a name by double click, I got the errors below:
2
I can still continue to label more objects, but none of them will be saved, the "Save" button is in gray and the Box Labels list is empty:
3

  • OS: Windows 10 1803
  • labelImg version: prebuilt binary Windows_v1.7.0

Most helpful comment

Did u still meet the issue? It should be fixed already if u uses the latest version

All 6 comments

Have you saved the problem?

Hello, have you solved this problem? I have encountered the same problem

Did u still meet the issue? It should be fixed already if u uses the latest version

@tzutalin
I tried the new Windows v1.8.1 release, it works fine now, big thanks!
You can close this issue now.

@liuyiyiyiyi @zhuolyang
The latest release works fine with Chinese labels now, just don't forget to save the "predefined_classes.txt" with UTF-8 encoding.

Thanks for verifying

Thank you.The latest relase is ok.

Was this page helpful?
0 / 5 - 0 ratings