Giter VIP home page Giter VIP logo

Comments (10)

LDOUBLEV avatar LDOUBLEV commented on May 22, 2024
  • 建议安装paddle1.7 吧,目前还没适配paddle1.8
    安装请参考:https://paddlepaddle.org.cn/install/quick
  • 报错信息在 tools/export_model.py, 这个是生成inference 模型的脚本,是不是生成的model和params文件有问题,也麻烦提供下你运行的指令吧

from paddleocr.

RABACCA8855 avatar RABACCA8855 commented on May 22, 2024

@LDOUBLEV 我的运行指令如下:

python3 tools/export_model.py -c configs/rec/rec_r34_vd_tps_bilstm_ctc.yml -o Global.checkpoints=./ch_lite/ec_r34_vd_tps_bilstm_ctc/best_accuracy
Global.save_inference_dir=./inference/rec/rec_r34_vd_tps_bilstm_ctc/

在/inference/rec/rec_r34_vd_tps_bilstm_ctc/ 成功生成了model和params文件。

from paddleocr.

tink2123 avatar tink2123 commented on May 22, 2024

在使用带tps的模型进行预测时,请添加参数 --rec_image_shape="3, 32, 100" --rec_char_type="en"
图片

后续我们会优化模型,简化预测过程,感谢使用

from paddleocr.

RABACCA8855 avatar RABACCA8855 commented on May 22, 2024

@tink2123 你好 我已经设置了相同的参数,并且更换了预测图片(英文),安装了paddlepaddle1.7.2,但是还是报了相同的错误。按照相同的方法下载了rec_crnn.tar,转化成iinference的model和params之后,就能预测成功。

from paddleocr.

tink2123 avatar tink2123 commented on May 22, 2024

预测时添加参数也报错吗? 预测时的命令可以发一下吗?

from paddleocr.

RABACCA8855 avatar RABACCA8855 commented on May 22, 2024

@tink2123 这是我预测命令。帖子的错误就是加载rec_r34_vd_tps_bilstm_ctc模型的时候报错的,但是加载rec_crnn就能预测成功。
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/"

from paddleocr.

tink2123 avatar tink2123 commented on May 22, 2024

在使用带tps的模型进行预测时,请添加参数 --rec_image_shape="3, 32, 100" --rec_char_type="en"

请试一下这个命令:
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./inference/det/" --rec_model_dir="./inference/rec/" --rec_image_shape="3, 32, 100" --rec_char_type="en"

rec_crnn 模型中没有grid_sampler这个op,所以没有影响。

from paddleocr.

RABACCA8855 avatar RABACCA8855 commented on May 22, 2024

@tink2123 已经成功了,谢谢你!我原本只是在rec_r34_vd_tps_bilstm_ctc.yml中修改参数,并且在utility中的 parser.add_argument中添加default路径,直接运行predict_system的,没注意修改rec_image_shape和rec_char_type的默认值。另外多问一句,这个模型只能预测英文小写字母和数字,是吧?

from paddleocr.

tink2123 avatar tink2123 commented on May 22, 2024

是的,目前发布的模型中,除了9m轻量级模型外,都只能预测英文。需要的话,您可以使用自己的中文数据训练后进行预测。

from paddleocr.

RABACCA8855 avatar RABACCA8855 commented on May 22, 2024

@tink2123 好的 非常感谢!

from paddleocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.