Comments (6)
检测模型已经导出且预测成功了,但是识别模型我发现配置文件不一样,无法导出成功
// 导出检测模型
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
from paddleocr2pytorch.
@JinXuan0604 请使用以下两个脚本试试:
./converter/ch_ppocr_v3_det_converter.py
./converter/ch_ppocr_v3_rec_converter.py
from paddleocr2pytorch.
@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:模型转换成功
from paddleocr2pytorch.
@JinXuan0604
1、paddleocr的之前也是CRNN,可能更新的时候调整了代码和配置,但算法是一样的
2、更新代码时哪里没有对齐,晚点看下
from paddleocr2pytorch.
@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 试一下:
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)
- PSE转换,用作者网盘里面提供的模型,paddle的效果要比torch好很多 HOT 1
- 作者,您好,什么时候可以自己训练的模型进行转换呢?非常期待您的工作 HOT 1
- 有误差 HOT 1
- Dependency issue
- paddle的检测模型出v4了,请问可以转换吗 HOT 7
- 借宝地推一下 ToddleOCR HOT 2
- 怎么把pth格式模型转化为移动端的pt 或者ptl 格式呢
- 请问pth模型如何使用paddle进行训练? HOT 2
- en_PP-OCRv3_rec convert/inference error HOT 1
- ch_ppocr_v3_rec_converter,为什么模型架构和官方不一样,head也没有没有MultiHead
- how to convert a finetuned student model (detection v3) HOT 1
- 这里面的pytorch模型如何使用bf16进行推理呢
- 这个项目的照顾要目的是转换模型吗?
- 运行例子出错,需要修改代码适配NumPy 1.24 HOT 1
- ppocr detv3检测模型转换出现问题 HOT 9
- vi-layoutxlm权重转pytorch HOT 1
- Added new models to the Google Drive folder. HOT 1
- 能否提供下requirements.txt,以及用的是什么python版本?
- 使用ch_ptocr_v4__rec_server_infer.pth模型推理的时候报错,加载的模型结构和模型参数匹配不上。 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddleocr2pytorch.