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

add logger module #180

Merged
merged 1 commit into from
Apr 19, 2023
Merged

add logger module #180

merged 1 commit into from
Apr 19, 2023

Conversation

MaigeWhite
Copy link
Collaborator

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)

@@ -69,6 +69,7 @@ loss_scaler:

train:
ckpt_save_dir: './tmp_rec'
log_interval: 100
Copy link
Collaborator

Choose a reason for hiding this comment

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

log_interval参数放到system下。

def __init__(self,
network,
epoch_size,
Copy link
Collaborator

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,
Copy link
Collaborator

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)

@@ -69,6 +69,7 @@ loss_scaler:

train:
ckpt_save_dir: './tmp_rec'
log_interval: 100
Copy link
Collaborator

Choose a reason for hiding this comment

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

删去,100为默认值

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

检测数据比较小,设置为100 step_end日志信息就没法输出

@@ -69,6 +69,7 @@ loss_scaler:

train:
ckpt_save_dir: './tmp_rec'
log_interval: 100
Copy link
Collaborator

Choose a reason for hiding this comment

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

del

def __init__(self,
network,
epoch_size,
batch_size,
logger,
Copy link
Collaborator

Choose a reason for hiding this comment

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

batch_size和logger这两个参数放在后面(按重要性和必要性排)

Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

请添加logger的单元测试代码至tests/ut中。

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'
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

与默认值相同,可删去。

@SamitHuang SamitHuang merged commit ac357ec into mindspore-lab:main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants