You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "references/classification/train_tensorflow.py", line 245, in <module>
main(args)
File "references/classification/train_tensorflow.py", line 124, in main
train_set = CharacterGenerator(
File "/home/laptopmindee/doctr/doctr/datasets/classification/tensorflow.py", line 29, in __init__
super().__init__(*args, **kwargs)
File "/home/laptopmindee/doctr/doctr/datasets/classification/base.py", line 58, in __init__
self._data = [synthesize_char_img(char, font_family=self.font_family) for char in self.vocab]
File "/home/laptopmindee/doctr/doctr/datasets/classification/base.py", line 58, in <listcomp>
self._data = [synthesize_char_img(char, font_family=self.font_family) for char in self.vocab]
File "/home/laptopmindee/doctr/doctr/datasets/classification/base.py", line 36, in synthesize_char_img
d.text((4, 0), char, font=font, fill=(255, 255, 255))
File "/home/laptopmindee/venv3.8/lib/python3.8/site-packages/PIL/ImageDraw.py", line 469, in text
draw_text(ink)
File "/home/laptopmindee/venv3.8/lib/python3.8/site-packages/PIL/ImageDraw.py", line 429, in draw_text
mask = font.getmask(
File "/home/laptopmindee/venv3.8/lib/python3.8/site-packages/PIL/ImageFont.py", line 149, in getmask
return self.font.getmask(text, mode)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 0: ordinal not in range(256)
Expected behavior
Display of samples
Environment
DocTR version: 0.3.1a0
TensorFlow version: 2.5.0
PyTorch version: 1.9.0+cu111 (torchvision 0.10.0+cu111)
OpenCV version: 4.5.1
OS: Ubuntu 18.04.5 LTS
Python version: 3.8
Is CUDA available (TensorFlow): Yes
Is CUDA available (PyTorch): Yes
CUDA runtime version: 11.4.100
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2060
Nvidia driver version: 470.57.02
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.2
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.
The text was updated successfully, but these errors were encountered:
Correct, I think we should add OS automatic detection and take a basic font that is compatible (Arial for windows & Mac for instance, FreeMono for Linux)
🐛 Bug
UnicodeEncode error for € when drawing with default PIL font.
To Reproduce
Steps to reproduce the behavior:
font=None
in the train loader ofreferences/classification/train_tensorflow.py
python references/classification/train_tensorflow.py mobilenet_v3_small --show-samples
Expected behavior
Display of samples
Environment
The text was updated successfully, but these errors were encountered: