-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 merge model scripts #5151
Add merge model scripts #5151
Conversation
… add_merge_model_scripts
python/paddle/utils/merge_model.py
Outdated
from paddle.proto import ModelConfig_pb2 | ||
from paddle.v2.topology import Topology | ||
|
||
def merge_model(net_out, param_file, output_file): |
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.
How about name it merge_v2_model
? I think it can only be used for v2 model.
python/paddle/utils/merge_model.py
Outdated
ends with .py. The parameters file stores the parameters of the model | ||
which ends with .tar.gz. | ||
|
||
@param net_out the output layer of the network |
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.
net
will be ok, _out
is puzzling.
python/paddle/utils/merge_model.py
Outdated
which ends with .tar.gz. | ||
|
||
@param net_out the output layer of the network | ||
@param param_file path of the model parameters file(a gzip file). |
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.
Path of model parameters (.tar.gz) which is stored by v2 api
python/paddle/utils/merge_model.py
Outdated
|
||
net_out = mobile_net(3*224*224, 102) | ||
param_file = YOUR_MODEL_PARAM_PATH | ||
output_file = OUTPUT_MERGED_FILE_PATH |
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.
param_file = param_pass_00000.tar.gz
output_file = out.paddle
… add_merge_model_scripts
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.
LGTM, and you need to merge the current develop branch.
… add_merge_model_scripts
Integrate the model config and model parameters into one file.
The model configuration file describes the model structure which ends with .py. The parameters file stores the parameters of the model which ends with .tar.gz.
@param net The output layer of the network
@param param_file Path of the model parameters(.tar.gz) which is stored by v2 api.
@param output_file Path of the merged file which will be generated
Usage: