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.prototxt 的 label #131

Closed
EdwardVincentMa opened this issue Jul 13, 2020 · 5 comments
Closed

大佬好!关于 train.prototxt 的 label #131

EdwardVincentMa opened this issue Jul 13, 2020 · 5 comments

Comments

@EdwardVincentMa
Copy link

EdwardVincentMa commented Jul 13, 2020

大佬您好,首先谢谢大佬的项目,很厉害!

训练有点不太会的地方想请教。以前训练过 mobilenet yolov3,里面的 train.prototxt 里面关联了 train 的图像路径,图像是lmdb形式,也就是要把图像和 label 转为 lmdb,然后还需要 label.prototxt。

看了您的 exemple/ocr/densenet下的 densenet-no-blstm_train-val.prototxt 的内容(以下用 train.prototxt 代替),没看到如何关联到 label 的。训练数据我下载了 Synthetic Chinese String Dataset,label 是 train.txt 和 test.txt ,

几点疑问:

  1. 不知道您这边怎么把 label 和 train.prototxt 关联起来;
  2. 不知道是否需要将图像转为 leveldb 形式
@mm1327
Copy link

mm1327 commented Jul 13, 2020

通过 convert_imageset 工具把label 和image 转为lmdb

@EdwardVincentMa
Copy link
Author

EdwardVincentMa commented Jul 14, 2020

通过 convert_imageset 工具把label 和image 转为 lmdb

感谢您的回答。您这个是多标签,一个图像后面10个文字也就是10个标签,我昨天尝试转 leveldb,在找 label 的时候,debug 发现好像只找最后一个 ‘ '(空格) 作为 label 的分割,也就是不适合多 class。

比如一张图10个字符,他只会找最后一个空格后的 506 作为 label,代码83行 line.find_last_of(' '),而把剩下的图像名称+余下9个字符作为图像名称,这显然是不对的,如下图所示:

image

是否需要改代码让其支持多个分类。

另外,不知道是转 lmdb 还是 leveldb。

@EdwardVincentMa
Copy link
Author

EdwardVincentMa commented Jul 14, 2020

通过 convert_imageset 工具把label 和image 转为 lmdb

感谢您的回答。您这个是多标签,一个图像后面10个文字也就是10个标签,我昨天尝试转 leveldb,在找 label 的时候,debug 发现好像只找最后一个 ‘ '(空格) 作为 label 的分割,也就是不适合多 class。

比如一张图10个字符,他只会找最后一个空格后的 506 作为 label,代码83行 line.find_last_of(' '),而把剩下的图像名称+余下9个字符作为图像名称,这显然是不对的,如下图所示:

image

是否需要改代码让其支持多个分类。

另外,不知道是转 lmdb 还是 leveldb。

谢谢楼上回答,我知道了为啥不支持多分类了,我这份代码太老了,不支持多分类。但还有些其它不明白的,例如:

  1. gray = true or false
  2. encoded = true or false

@EdwardVincentMa
Copy link
Author

多标签的 convert_imageset.cpp 放到我的项目里不能用,要改很多代码,如何建立基于作者项目里面的 convert_imageset.cpp 的项目,我建立后,link error

已解决,找了个笨办法,可以跑多标签转换了

@xiaotaia
Copy link

多标签的 convert_imageset.cpp 放到我的项目里不能用,要改很多代码,如何建立基于作者项目里面的 convert_imageset.cpp 的项目,我建立后,link error

已解决,找了个笨办法,可以跑多标签转换了

请问这个中文多标签lmdb是怎么做的?另外作者项目里没有convert_imageset.cpp啊。作者这个模型可以用hdf5类型的数据训练么?

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