-
Notifications
You must be signed in to change notification settings - Fork 56
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
add logger module #180
add logger module #180
Conversation
configs/rec/crnn/crnn_icdar15.yaml
Outdated
@@ -69,6 +69,7 @@ loss_scaler: | |||
|
|||
train: | |||
ckpt_save_dir: './tmp_rec' | |||
log_interval: 100 |
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_interval参数放到system下。
mindocr/utils/callbacks.py
Outdated
def __init__(self, | ||
network, | ||
epoch_size, |
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.
不用传epoch_size,这个callback内部可通过cb_params.epoch_num获取
另外,命名保持一致: num_epochs
tools/train.py
Outdated
main_indicator=cfg.metric.main_indicator, | ||
val_interval=cfg.system.get('val_interval', 1), | ||
val_start_epoch=cfg.system.get('val_start_epoch', 1), | ||
log_interval=cfg.train.log_interval, |
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_interval 加一个默认值 ,cfg.system.get('log_interval', 100)
configs/rec/crnn/crnn_resnet34.yaml
Outdated
@@ -69,6 +69,7 @@ loss_scaler: | |||
|
|||
train: | |||
ckpt_save_dir: './tmp_rec' | |||
log_interval: 100 |
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.
删去,100为默认值
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.
检测数据比较小,设置为100 step_end日志信息就没法输出
configs/rec/crnn/crnn_vgg7.yaml
Outdated
@@ -69,6 +69,7 @@ loss_scaler: | |||
|
|||
train: | |||
ckpt_save_dir: './tmp_rec' | |||
log_interval: 100 |
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.
del
mindocr/utils/callbacks.py
Outdated
def __init__(self, | ||
network, | ||
epoch_size, | ||
batch_size, | ||
logger, |
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.
batch_size和logger这两个参数放在后面(按重要性和必要性排)
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.
logger和batch_size是必须传的参数, 训练日志用logger输出,计算fps需要batch_size
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.
请添加logger的单元测试代码至tests/ut中。
ec918ee
to
a96fe49
Compare
tools/train.py
Outdated
print('='*40) | ||
logger.info('=' * 40) | ||
logger.info( | ||
f'Num devices: {device_num if device_num is not None else 1}\n' |
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信息有缺失,请与最新的commit同步。
@@ -3,6 +3,7 @@ system: | |||
distribute: False | |||
amp_level: 'O0' | |||
seed: 42 | |||
log_interval: 100 |
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.
与默认值相同,可删去。
@@ -3,6 +3,7 @@ system: | |||
distribute: True | |||
amp_level: 'O3' | |||
seed: 42 | |||
log_interval: 100 |
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.
与默认值相同,可删去。
@@ -3,6 +3,7 @@ system: | |||
distribute: True | |||
amp_level: 'O3' | |||
seed: 42 | |||
log_interval: 100 |
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.
与默认值相同,可删去。
@@ -3,6 +3,7 @@ system: | |||
distribute: True | |||
amp_level: 'O0' | |||
seed: 42 | |||
log_interval: 100 |
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.
与默认值相同,可删去。
Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:
Motivation
(Write your motivation for proposed changes here.)
Test Plan
(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)
Related Issues and PRs
(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)