Skip to content
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

Upgrade applications/text_classifications/multi_class to use Trainer API #3679

Merged
merged 12 commits into from
Nov 17, 2022

Conversation

sijunhe
Copy link
Collaborator

@sijunhe sijunhe commented Nov 4, 2022

PR types

Function optimization

PR changes

Others

Description

Upgrade applications/text_classifications/multi_class to use Trainer API

@ZeyuChen ZeyuChen requested review from lugimzzz and ZHUI November 5, 2022 08:34
- `device`: 使用的设备,默认为`gpu`。
- `per_device_train_batch_size`: 每次训练每张卡上的样本数量。可根据实际GPU显存适当调小/调大此配置。
- `per_device_eval_batch_size`: 每次评估每张卡上的样本数量。可根据实际GPU显存适当调小/调大此配置。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

找不到save_strategy的参数说明,整体检查下使用的配置是否有欠缺

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为支持了Trainer的原因,增加了大量可使用的参数. 所以这里只是说明了一些用户可能调整的主要参数。剩下的参数在文档中链接了TrainingArguments的参数文档,供用户查阅

--metric_for_best_model accuracy \
--load_best_model_at_end \
--evaluation_strategy epoch \
--save_strategy epoch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增一个可配置参数--save_total_limit 1,限制保存的epoch数

@sijunhe
Copy link
Collaborator Author

sijunhe commented Nov 17, 2022

Addressed comments from @lugimzzz

Copy link
Contributor

@lugimzzz lugimzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sijunhe sijunhe merged commit 60a51f0 into PaddlePaddle:develop Nov 17, 2022
@sijunhe sijunhe deleted the text_class_trainer branch November 17, 2022 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants