Attention-ocr-Chinese-Version icon indicating copy to clipboard operation
Attention-ocr-Chinese-Version copied to clipboard

使用与训练模型

Open hsl20130659 opened this issue 5 years ago • 10 comments

我想跑测试一下你开源的模型,但是遇到shape不一致的问题,你的网络对输入图片的尺寸有什么限制吗?然后可以单张测试吗,我看你的demo_inference.py 用的是批量处理,如果要测试单张图片应该怎么改呢?

hsl20130659 avatar Dec 11 '18 03:12 hsl20130659

@hsl20130659 你好,你可以把demo_inference.py中的batch_size设为1就能测单张图片了,测试时输入的尺寸应该是没有要求的,在demo_inference.py的第55行,应该把2尺寸换成你当时训练时的图片输入尺寸

A-bone1 avatar Dec 11 '18 08:12 A-bone1

我试了batchsize=1,还是会报这个错误:Assign requires shapes of both tensors to match. lhs shape= [256,5463] rhs shape= [256,134]

hsl20130659 avatar Dec 11 '18 08:12 hsl20130659

@hsl20130659 这应该是最后输出层的问题,我的模型是应用在汉字识别中,一共有5463个词,而134应该是谷歌官方提供的dic.txt,是包含英文字母和一些特殊字符的。

A-bone1 avatar Dec 11 '18 08:12 A-bone1

你的模型可以同时识别汉字、字母和数字等吗?我换下模型看看

hsl20130659 avatar Dec 11 '18 08:12 hsl20130659

理论上dic.txt里有的字符,而且训练集也有相应的字符,就可以识别。字母和数字是有包含在dic.txt里的

A-bone1 avatar Dec 11 '18 09:12 A-bone1

你自己训练的模型没有放出来?

hsl20130659 avatar Dec 11 '18 09:12 hsl20130659

是的,因为还处于研究阶段

A-bone1 avatar Dec 11 '18 09:12 A-bone1

那我这边如果只想识别数字的话,应该改哪边可以运行134的模型?

hsl20130659 avatar Dec 11 '18 09:12 hsl20130659

@hsl20130659 你解决这个问题了吗 , 我换了一个dic.txt和你一样的问题

sporterman avatar Sep 29 '19 06:09 sporterman

是的,因为还处于研究阶段

作者您好,请问什么时候会公布 训练好的模型呢?自己训练的模型效果太差了。或者有谁有训练好的嘛?感谢

Byronnar avatar Oct 24 '19 08:10 Byronnar