-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[WIP]support export after save model #9134
base: develop
Are you sure you want to change the base?
[WIP]support export after save model #9134
Conversation
Thanks for your contribution! |
ppdet/engine/trainer.py
Outdated
@@ -75,7 +75,7 @@ def __init__(self, cfg, mode='train'): | |||
self.custom_white_list = self.cfg.get('custom_white_list', None) | |||
self.custom_black_list = self.cfg.get('custom_black_list', None) | |||
self.use_master_grad = self.cfg.get('master_grad', False) | |||
if 'slim' in cfg and cfg['slim_type'] == 'PTQ': | |||
if ('slim' in cfg and cfg['slim_type'] == 'PTQ') or 'model_export_enabled' in cfg: |
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.
更改变量名,统一模型输出
ppdet/engine/trainer.py
Outdated
@@ -1212,8 +1212,13 @@ def _get_infer_cfg_and_input_spec(self, | |||
"img_name": str, | |||
}) | |||
if prune_input: | |||
if self.cfg.get("model_export_enabled", False): |
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.
self.xxx. 不做判断
ppdet/engine/trainer.py
Outdated
super().__init__() | ||
self.base_model = model | ||
|
||
def eval(self): |
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.
是否必要
ppdet/engine/callbacks.py
Outdated
save_name, | ||
epoch_id + 1, | ||
ema_model=weight) | ||
if self.model_export_enabled: |
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.
ema 静态图, else
ppdet/engine/export_utils.py
Outdated
@@ -366,7 +366,8 @@ def _dump_infer_config(config, path, image_shape, model): | |||
else: | |||
reader_cfg = config['TestReader'] | |||
dataset_cfg = config['TestDataset'] | |||
|
|||
# print(dataset_cfg) | |||
# exit() |
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.
删掉
19855ad
to
f0a3ab9
Compare
f0a3ab9
to
38fe21b
Compare
38fe21b
to
e155a3d
Compare
No description provided.