yizt / crnn.pytorch

crnn实现水平和垂直方向中文文字识别, 提供在3w多个中文字符训练的水平识别和垂直识别的预训练模型; 欢迎关注,试用和反馈问题... ...
Apache License 2.0
244 stars 52 forks source link

我在all words.txt里放了10个汉字,尝试运行generator.py,报了以下错误,怎么解决?微信nlanguage Traceback (most recent call last): File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 227, in <module> test_image_gen('horizontal') File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 207, in test_image_gen im, indices, target_len = gen.gen_image() File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 158, in gen_image text = np.random.choice(FONT_CHARS_DICT[font_path], target_len) File "mtrand.pyx", line 908, in numpy.random.mtrand.RandomState.choice ValueError: 'a' cannot be empty unless no samples are taken #30

Open nissansz opened 2 years ago

nissansz commented 2 years ago

我在all words.txt里放了10个汉字,尝试运行generator.py,报了以下错误,怎么解决?微信nlanguage Traceback (most recent call last): File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 227, in test_image_gen('horizontal') File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 207, in test_image_gen im, indices, target_len = gen.gen_image() File "F:/pycharm2020.2/crnn.pytorch_generator/generator.py", line 158, in gen_image text = np.random.choice(FONT_CHARS_DICT[font_path], target_len) File "mtrand.pyx", line 908, in numpy.random.mtrand.RandomState.choice ValueError: 'a' cannot be empty unless no samples are taken