-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[AutoNLP]optimize log #5021
[AutoNLP]optimize log #5021
Conversation
Thanks for your contribution! |
@@ -156,25 +156,6 @@ def on_evaluate(self, args, state, control, **kwargs): | |||
if self.tune.is_session_enabled() and metrics is not None and isinstance(metrics, dict): | |||
self.session.report(metrics) | |||
|
|||
# report session metrics to Ray to track trial progress | |||
def on_epoch_end(self, args, state, control, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输入并没有metrics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on_epoch_end 应该会返回一些训练方面的东西,例如loss, iter/s之类的训练指标,可以再看看
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来trainer.py中on_epoch_end没有传入metrics,所以这个函数无法report任何东西
https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/trainer/trainer.py#L731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不过那些信息没什么用,不要也ok,可以删
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测只需要merge develop就能解决
stdout_handler = logging.StreamHandler(sys.stdout) | ||
stdout_handler.setFormatter(logger.format) | ||
logger.logger.addHandler(stdout_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样子能把所有的log都显示出来吗?如果可以的话,就太好了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以,并且可以区分info error warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
赞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再确认以下几个case:
- verbosity >0的时候,notebook里有log, 文件里有log
- verbosity =0的时候, notebook里没有log, 但是文件里还是有log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确认没有问题。
@@ -156,25 +156,6 @@ def on_evaluate(self, args, state, control, **kwargs): | |||
if self.tune.is_session_enabled() and metrics is not None and isinstance(metrics, dict): | |||
self.session.report(metrics) | |||
|
|||
# report session metrics to Ray to track trial progress | |||
def on_epoch_end(self, args, state, control, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on_epoch_end 应该会返回一些训练方面的东西,例如loss, iter/s之类的训练指标,可以再看看
Codecov Report
@@ Coverage Diff @@
## develop #5021 +/- ##
===========================================
+ Coverage 48.40% 48.41% +0.01%
===========================================
Files 454 454
Lines 65390 65383 -7
===========================================
+ Hits 31649 31654 +5
+ Misses 33741 33729 -12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work!
PR types
Function optimization
PR changes
APIs
Description
将所有logger内容放到train.log中