Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

为PaddleOCR增加训练时周期性验证的开关 #11132

Closed
chenjjcccc opened this issue Oct 24, 2023 · 1 comment
Closed

为PaddleOCR增加训练时周期性验证的开关 #11132

chenjjcccc opened this issue Oct 24, 2023 · 1 comment
Assignees

Comments

@chenjjcccc
Copy link

为PaddleOCR增加训练时周期性验证的开关

任务描述

任务背景

  • 为PaddleOCR增加训练时周期性验证的开关;为PaddleOCR增加eval_epoch_step参数。与PaddleCV的其它基础套件PaddleSeg、PaddleDetection、PaddleClas、Paddle3D等不同,PaddleOCR不支持上述功能,这导致包括但不限于如下问题:用户有时只想要将模型训练一定的迭代轮数,并不希望在训练时进行精度评估(这可能带来额外的时间开销),而目前PaddleOCR无法优雅地满足这个需求,只能通过设定一个较大的eval_batch_step数值来实现。更换数据集后,由于数据集大小发生改变,用户往往也需要修改eval_batch_step配置,以使得eval频率合适。PaddleOCR中实现的是epoch-based trainer,在配置文件中设置的也是epoch_num而不是num_iters,但eval_batch_step却是iters粒度的控制,存在风格不契合的问题。

完成步骤

  1. 增加do_eval配置项,可用于关闭训练时周期性验证。默认启用验证,基本维持PaddleOCR现有行为,但希望在训练结束时,即使没有到达eval_step,也进行一次验证(因为有时候eval_step设置不合适,可能会出现指定了do_eval却没有验证的情况,不符合直觉)。
  2. 在保留eval_batch_step的情况下,增加eval_epoch_step配置项。关于eval_batch_step与eval_epoch_step之间的关系如何,例如二者互斥或其中一个的优先级更高,我还没有想好,建议开发者从用户使用便利性的角度考虑如何设计。eval_batch_step应当被添加为可选功能,套件的默认行为保持不变。

提交内容:

  1. 提交修改到PaddleOCR。
@sylarwcy
Copy link
Contributor

我测试了v3版本的模型训练,训练过程中eval时,显存不断的涨,涨很多,最后涨到显存溢出,out of memory,程序崩溃退出。我显卡是11G显存,eval都会导致显存不足崩溃退出程序。

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jun 10, 2024
@SWHL SWHL converted this issue into discussion #12876 Jun 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants