GithubHelp home page GithubHelp logo

Comments (6)

JinXuan0604 avatar JinXuan0604 commented on September 26, 2024

检测模型已经导出且预测成功了,但是识别模型我发现配置文件不一样,无法导出成功
// 导出检测模型
python3 ./converter/det_converter.py --yaml_path ./configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det.yml --src_model_path /home/output/CCPD/det/

// 检测模型预测
python ./tools/infer/predict_det.py --det_model_path infer.pth --image_dir '/home/vlpRecognition/CCPD2020/ccpd_green/val/3025-96_108-271&444_511&549-511&549_293&523_271&444_495&459-0_0_3_24_32_32_32_33-81-159.jpg' --det_yaml_path ./configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det.yml

// 导出识别模型,模型配置文件不一样导致导出失败
image

from paddleocr2pytorch.

frotms avatar frotms commented on September 26, 2024

@JinXuan0604 请使用以下两个脚本试试:

./converter/ch_ppocr_v3_det_converter.py

./converter/ch_ppocr_v3_rec_converter.py 

from paddleocr2pytorch.

JinXuan0604 avatar JinXuan0604 commented on September 26, 2024

@JinXuan0604 请使用以下两个脚本试试:

./converter/ch_ppocr_v3_det_converter.py

./converter/ch_ppocr_v3_rec_converter.py 

这个脚本我昨天试过,识别模型可以转换成功,但是有2个问题,1个是ch_ppocr_v3_rec_converter.py脚本代码中第78行'algorithm':'CRNN',这与原paddleocr的算法(algorithm: SVTR_LCNet)并不一致,另1个问题是我使用导出的模型进行识别,输出都是空。
图片1:模型转换成功
image

图片2:导出后的模型试了很多张图片,输出都是空
image

from paddleocr2pytorch.

frotms avatar frotms commented on September 26, 2024

@JinXuan0604
1、paddleocr的之前也是CRNN,可能更新的时候调整了代码和配置,但算法是一样的
2、更新代码时哪里没有对齐,晚点看下

from paddleocr2pytorch.

frotms avatar frotms commented on September 26, 2024

@JinXuan0604 试一下:

python ./converter/ch_ppocr_v3_rec_converter.py --src_model_path ch_PP-OCRv3_rec_train

python ./tools/infer/predict_rec.py  --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir ./doc/imgs_words/ch/word_1.jpg

我这里是可以正常推理的。如果还不行可以加QQ私聊下

from paddleocr2pytorch.

JinXuan0604 avatar JinXuan0604 commented on September 26, 2024

@JinXuan0604 试一下:

python ./converter/ch_ppocr_v3_rec_converter.py --src_model_path ch_PP-OCRv3_rec_train

python ./tools/infer/predict_rec.py  --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir ./doc/imgs_words/ch/word_1.jpg

我这里是可以正常推理的。如果还不行可以加QQ私聊下

我找到原因了,我对预训练模型提取了学生模型的权重,然后基于这个权重使用CCPD车牌数据集进行了微调,使用python ./converter/ch_ppocr_v3_rec_converter.py --src_model_path /home/PaddleOCR/output/CCPD/rec/命令进行转换时报错KeyError: 'Student.backbone.conv1._conv.weight',这时候我修改了ch_ppocr_v3_rec_converter.py文件中的load_paddle_weights函数,将节点名称转换代码注释掉了,这时候转换预训练模型和我微调后的预训练模型都可以成功,但是推理时输出时空的。

那么问题来了,我想要的是转换微调后的预训练模型,为什么可以成功转换而推理为空呢?

我的qq是459754206,很感谢你的解答

from paddleocr2pytorch.

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.