Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同一批图片,train 和eval 的准确度都很高,然后用导出的模型做预测,结果完全不对。 #2782

Closed
deannazhang-dot opened this issue May 13, 2021 · 5 comments

Comments

@deannazhang-dot
Copy link

用自己的数据集训练之后预测效果比较差,为了跑通自定义数据集训练,做了如下实验。
1 用opencv 随机生成1000张尺寸为1500*900的图片,上面随机生成了5行文字(数字和英文混合,随机生成图片如下)
image

2 对1000张图片用paddleOCR 的标注工具进行半自动化标注,标注完成之后进行检测训练,为了方便,我把train数据集也设置成了eavl数据集,用DB模型做检测训练,结果显示eval上准确度达到95%以上,但是我用同一批训练的数据拿去做预测,预测结果如下,其中蓝色部分为识别到的文字区域,感觉完全不对,不知道是什么原因导致的,困惑中。

image

@LDOUBLEV
Copy link
Collaborator

  • 检查导出模型使用的yml文件是否是和训练用的yml文件是一致的
  • 检查导出模型时,pretrained_model是否load到定义的网络中

@deannazhang-dot
Copy link
Author

千算,万算,发现是自己到export 模型的时候,少加了这一句Global.load_static_weights 参数需要设置为 False。另外还发现一个问题就是我的yml文件中DetResizeForTest: image shape:[736,1280],追到源码里面看发现这句会把输入图像预处理成736*1280尺寸,但最后predict的时候,里面默认是不设置DetResizeForTest这一项的,后面把yml的配置文件里这一项也屏蔽了。目前貌似至少正常点了,太不容易了。。。。。。

@LDOUBLEV
Copy link
Collaborator

LDOUBLEV commented May 13, 2021

恭喜大佬踩坑,你说的这两个问题在最新代码里都修复了,去掉了Global.load_static_weights 参数, DetResizeForTest: image shape:[736,1280], 在中文检测的配置文件下也屏蔽了

@Dandelion111
Copy link

恭喜大佬踩坑,你说的这两个问题在最新代码里都修复了,去掉了Global.load_static_weights 参数, DetResizeForTest: image shape:[736,1280], 在中文检测的配置文件下也屏蔽了

请问如果的训练DBNet训练集输入是224*224,那么验证集大小应该如何设置?默认的是把短边resize到736好像不合适

@paddle-bot-old
Copy link

Since you haven't replied for more than 3 months, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
It is recommended to pull and try the latest code first.
由于您超过三个月未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

an1018 pushed a commit to an1018/PaddleOCR that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants