我在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
我在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
我在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