-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
add center loss cod and cfg #4165
add center loss cod and cfg #4165
Conversation
Thanks for your contribution! |
epoch_num: 800 | ||
log_smooth_window: 20 | ||
print_batch_step: 10 | ||
save_model_dir: ./output/rec_mobile_pp-OCRv2_center_loss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议将center改成enhanced_ctc, center并不准确。 arxiv论文上也是这么对外宣传的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的, 已修改
infer_mode: false | ||
use_space_char: true | ||
distributed: true | ||
save_res_path: ./output/rec/predicts_mobile_pp-OCRv2_center_loss.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
algorithm: CRNN | ||
Transform: | ||
Backbone: | ||
name: MobileNetV1Enhance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是已经确定叫LCNet了,如果确定了,可以直接写LCNet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块由于pretrain已经开源,目前修改风险可能比较高,暂时感觉修改不太合适
num_classes: 6625 | ||
feat_dim: 96 | ||
init_center: false | ||
center_file_path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
提供一个默认路径吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,已提供
|
||
feats_reshape = paddle.reshape( | ||
features, [-1, features.shape[-1]]).astype("float64") | ||
label = paddle.argmax(predicts, axis=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的标签,是不是应该使用batch也就是gt进行计算,predicts是预测的标签?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCR识别里面,是没有显式的对齐标签的;所以训练的时候gt没法拿来使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,用gt是没有对齐的有明显的问题,但是会不会存在用predicts因为不是正确的标签,计算出来的centerloss引入比较大的偏差,从而导致学习出的“center”质量不是很高?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果center不做初始化的话,确实会影响效果;PPOCR-V2的方案,会先基于单纯的ctcloss,训练一个模型;然后基于训练数据提取center来做初始化。 另外,centerloss的权重一般也不会设置得很大
|
No description provided.