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

rec_r34_vd_tps_bilstm_attn模型转inference模型失败,请问是什么问题? #76

Closed
vinceyzw opened this issue May 20, 2020 · 4 comments

Comments

@vinceyzw
Copy link

运行命令:
python3 tools/export_model.py -c configs/rec/rec_r34_vd_tps_bilstm_attn.yml -o Global.checkpoints=./ch_lite/rec_r34_vd_tps_bilstm_attn/best_accuracy Global.save_inference_dir=./inference_model/rec_r34/

出现报错:
Traceback (most recent call last):
File "tools/export_model.py", line 93, in
main()
File "tools/export_model.py", line 67, in main
config, eval_program, startup_prog)
File "/root/PaddleOCR-develop/tools/program.py", line 193, in build_export
image, outputs = model(mode='export')
File "/root/PaddleOCR-develop/ppocr/modeling/architectures/rec_model.py", line 112, in call
predict = predicts['predict']
KeyError: 'predict'

@dyning
Copy link
Collaborator

dyning commented May 20, 2020

由于基于Attention损失的识别模型和基于CTC的识别模型推理差别很大,目前还在调试中。对于中文文本识别,建议优先选择基于CTC损失的识别模型,实践中也发现基于Attention损失的效果不如基于CTC损失的识别模型。

@LDOUBLEV
Copy link
Collaborator

LDOUBLEV commented Jun 8, 2020

已解决attention模型转inference model的问题

@chenxuezhao
Copy link

chenxuezhao commented Jun 10, 2021

@LDOUBLEV 你好,请问您是怎么解决的?我用export_model.py 转换attention模型为inference model的时候会报

ValueError: All elements in shape must be positive when it's a list or tuple

的错误。我的转换命令如下:

python3 tools/export_model.py -c configs/rec/rec_r34_vd_tps_bilstm_att.yml -o Global.checkpoints=./output/rec/rec_r34_vd_tps_bilstm_att/best_accuracy Global.save_inference_dir=./inference/rec_att

BillDior pushed a commit to BillDior/PaddleOCR that referenced this issue Aug 13, 2021
@nissansz
Copy link

crnn配置中的attention 和ctc loss哪个准确率高?rec_r34_vd_none_bilstm_ctc.yml rec_r34_vd_none_none_ctc.yml rec_r34_vd_tps_bilstm_att.yml rec_r34_vd_tps_bilstm_ctc.yml

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

5 participants