Comments (7)
@zcswdt 你好,感谢反馈;没有使用实际的数据训练,使用的是随机生成的数据训练,代码在generator.py
中
from crnn.pytorch.
谢谢您的百忙之中的回复,我刚看了您的生成文字代码,写的非常棒,授人以鱼不如授人以渔。刚好我在做一个繁体字识别的项目,目前我没有繁体字数据集,还在发愁呢。可以问一下,繁体字识别的话,使用crnn模型最低要训练多少张图片呢?
from crnn.pytorch.
@zcswdt 具体需要多少,不清楚,没有实际测试过
from crnn.pytorch.
您好,我使用您的generator.py生成图片的过程中会报错,我是python3的环境,这个报错我谷歌了解决方法,最后没有解决,是我哪里错了吗?希望得到您的回复。
报错如下:
root@8a3c4a48fd90:/mywork/craft/crnn_ziti# PYTHONIOENCODING=utf-8 python generator.py
Traceback (most recent call last):
File "generator.py", line 15, in
from fontutils import FONT_CHARS_DICT
File "/mywork/craft/crnn_ziti/fontutils.py", line 81, in
FONT_CHARS_DICT = get_all_font_chars()
File "/mywork/craft/crnn_ziti/fontutils.py", line 30, in get_all_font_chars
font_list = [ImageFont.truetype(font_path, size=10) for font_path in font_path_list]
File "/mywork/craft/crnn_ziti/fontutils.py", line 30, in
font_list = [ImageFont.truetype(font_path, size=10) for font_path in font_path_list]
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 640, in truetype
return freetype(font)
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 637, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 186, in init
font, size, index, encoding, layout_engine=layout_engine
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-41: ordinal not in range(128)
from crnn.pytorch.
@zcswdt 我也是python3.6, 相关包版本如下,在mac和linux上都有测试过:
Pillow 5.4.1
opencv-python 4.1.0.25
fonttools 4.2.2
numpy 1.16.2
from crnn.pytorch.
您好,谢谢您的回复,我已经解决了该问题。但是我在读代码的时候发现,在generator.py文件,class Generator:传进去两个参数,其中self.alpha_list = list(alpha)代表是词库,但是并没有在接下来代码中用到,可以加个qq或者微信沟通一下吗?谢谢!
from crnn.pytorch.
@zcswdt 跟alpha重复了,后面用的是alpha;这个是没有用;我的微信号:yizuotian131
from crnn.pytorch.
Related Issues (20)
- 请教一下如何训练自己的数据集,数据格式以及存放目录怎么配置 HOT 2
- 问下,你验证集上,acc可以大概达到多少 HOT 4
- 用自己的字典替换你的all_word.txt文件,训练报错 HOT 11
- 下载目录无权限 HOT 2
- hi,thank you for the great codes. But I have met some problems. I just download the code, and run using distribute training mode, HOT 7
- 训练数据怎么生成的? HOT 11
- 请教 HOT 15
- 请教*2 HOT 2
- training data generation HOT 3
- result output confidence
- 单卡和多卡设置问题 HOT 1
- 印刷体纯数字识别效果不是太好,有解决办法吗?
- number of dims don't match in permute HOT 1
- 是否可以修改预训练模型的输出层后进行迁移学习呢?
- 接着预训练模型接着训练一直是inf? HOT 3
- 这个不可以转ONNX测试吧
- 我尝试用cpu训练。报错了,怎么解决?微信nlanguage 。 py -3 train.py --direction horizontal
- 我在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
- win10直接运行train.py 报错。微信nlanguage ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle 'Font' object HOT 1
- 字符集中有的字符例如\u3000在python下没法显示报错,怎么去掉?微信nlanguage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crnn.pytorch.