Update save inference model to support dygraph#25894
Merged
guoshengCS merged 51 commits intoPaddlePaddle:developfrom Aug 25, 2020
Merged
Update save inference model to support dygraph#25894guoshengCS merged 51 commits intoPaddlePaddle:developfrom
guoshengCS merged 51 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
guoshengCS
reviewed
Aug 6, 2020
guoshengCS
reviewed
Aug 6, 2020
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
7d9806f to
fa11228
Compare
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
… update_save_inference_model_to_support_dygraph
saxon-zh
reviewed
Aug 24, 2020
python/paddle/incubate/hapi/model.py
Outdated
|
|
||
| The parameters contains all the trainable Variable, will save to | ||
| a file with suffix ".pdparams". | ||
| If `for_inference` is set to Fasle, the parameters saved contain all |
saxon-zh
reviewed
Aug 24, 2020
python/paddle/incubate/hapi/model.py
Outdated
| path (str): The file prefix to save model. The format is | ||
| 'dirname/file_prefix' or 'file_prefix'. if empty str. A exception | ||
| will be raised. | ||
| for_inference (bool): Whether to save inference model only. Default: False. |
saxon-zh
reviewed
Aug 24, 2020
| def __init__(self): | ||
| super(MyNet, self).__init__() | ||
| self._fc = fluid.dygraph.Linear(784, 1, act='softmax') | ||
| import paddle.incubate.hapi as hapi |
XiaoguangHu01
previously approved these changes
Aug 24, 2020
python/paddle/incubate/hapi/model.py
Outdated
| def save(self, path): | ||
| """ | ||
| This function saves parameters, optimizer infomation to path. | ||
| def save(self, path, for_inference=False): |
Contributor
There was a problem hiding this comment.
for_inference=False -> training=True
建议跟组网类的API的参数保持一致,用training这个参数标识训练和预测
3e6f384
XiaoguangHu01
previously approved these changes
Aug 25, 2020
… update_save_inference_model_to_support_dygraph
Heeenrrry
approved these changes
Aug 25, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
APIs
Describe
Update save_inference_model in Hapi to support dygraph. And it will be no longer exposed to users, and users can use
save, and settraining=Falseto save inference model.