Replies: 5 comments
-
如果未加载 Student 预训练模型,可能导致训练效率低、精度收敛差等问题。Teacher模型理论上加载配置中给的那个预训练模型是可以的,但是还是建议优先使用官方提供的同类型预训练模型作为起点。 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
好的,感谢 |
Beta Was this translation helpful? Give feedback.
-
您知道那两个参数作用是什么吗? |
Beta Was this translation helpful? Give feedback.
-
你问到:
下面结合你的配置内容详细解答: 1. Student 模型是否需要加载预训练模型?在你的 ch_PP-OCRv4_det_cml.yml 配置里,Student 和 Student2 的 Backbone 预训练策略如下: Student:
Backbone:
name: PPLCNetV3
scale: 0.75
pretrained: false
Student2:
Backbone:
name: PPLCNetV3
scale: 0.75
pretrained: true
而且 Student2 外部还有一行 Student2:
pretrained: null 这意思是整个 Student2 不加载外部预训练参数文件(如大模型 结论
2. Teacher 模型加载哪个预训练模型?你的配置如下: Teacher:
pretrained: https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_cml_teacher_pretrained/teacher.pdparams
freeze_params: true Teacher 只需要加载你在配置里指定的预训练模型即可,不需要自己再写别的下载或加载代码。
小结与建议
相关 issue 参考上述策略也符合 PaddleOCR 官方项目中类似的配置惯例(详见 OCRv4_det_cml 检测指标较低 #14149 等),一般都是Teacher加载官方给定预训练模型,Student根据需求选择。 回答总结:
如需自定义指定的预训练权重路径,可在Backbone里用 如果还有相关的训练参数和蒸馏效果问题,可参考 相关 issue 14149。 Response generated by 🤖 feifei-bot | gpt-4.1 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🔎 Search before asking
🐛 Bug (问题描述)
使用ch_PP-OCRv4_det_cml.yml蒸馏训练一个特定场景的模型,两个Student模型需要加载预训练模型吗,Teacher模型加载配置中给的那个预训练模型就行吗
🏃♂️ Environment (运行环境)
python 3.8
paddlepaddle-gpu 2.5.2
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
python tools/train.py -c configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_cml.yml
Beta Was this translation helpful? Give feedback.
All reactions