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

导出识别模型时都是 KeyError: 'predict' #29

Closed
BackT0TheFuture opened this issue May 14, 2020 · 3 comments
Closed

导出识别模型时都是 KeyError: 'predict' #29

BackT0TheFuture opened this issue May 14, 2020 · 3 comments

Comments

@BackT0TheFuture
Copy link

BackT0TheFuture commented May 14, 2020

paddlepaddle-gpu 1.7.2.post107
PaddleOCR 3b40c32

python tools/export_model.py -c configs/rec/rec_r34_vd_tps_bilstm_attn.yml -o Global.checkpoints="./output/rec/rec_r34_vd_tps_bilstm_attn/best_accuracy" Global.save_inference_dir="./inference/rec/rec_r34_vd_tps_bilstm_attn"

python tools/export_model.py -c configs/rec/rec_mv3_tps_bilstm_attn.yml -o Global.checkpoints="./output/rec/rec_mv3_tps_bilstm_attn/best_accuracy" Global.save_inference_dir="./inference/rec/rec_mv3_tps_bilstm_attn"

Traceback (most recent call last):
  File "tools/export_model.py", line 94, in <module>
    main()
  File "tools/export_model.py", line 68, in main
    config, eval_program, startup_prog)
  File "PaddleOCR\tools\program.py", line 193, in build_export
    image, outputs = model(mode='export')
  File "PaddleOCR\ppocr\modeling\architectures\rec_model.py", line 112
, in __call__
    predict = predicts['predict']
KeyError: 'predict'
@dyning
Copy link
Collaborator

dyning commented May 15, 2020

感谢关注和试用,目前还在紧急修复和更新相关文档中。今天会同步进展。

@dyning
Copy link
Collaborator

dyning commented May 15, 2020

推理文档已经更新,
https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/inference.md

里面介绍详细介绍了超轻量中文识别模型推理和基于CTC损失的识别模型推理。而基于Attention损失的识别模型推理还在调试中。对于中文文本识别,建议优先选择基于CTC损失的识别模型,实践中也发现基于Attention损失的效果不如基于CTC损失的识别模型。

@LDOUBLEV
Copy link
Collaborator

LDOUBLEV commented Jun 8, 2020

attention模型转inference model 问题已修复

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