Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

add merge_config_parameters scripts #20

Merged
merged 4 commits into from
Nov 7, 2017

Conversation

NHZlX
Copy link
Contributor

@NHZlX NHZlX commented Oct 25, 2017

fix #19
modify readme in pruning
rename $Mobile/tool to $Mobile/tools

@NHZlX NHZlX requested review from hedaoyuan and Xreki October 25, 2017 13:44
@NHZlX NHZlX changed the title add merge config and parameters scripts and modify readme in pruning add merge_config_parameters scripts Oct 25, 2017
Merge_model().do_merge()

print 'Generate ', MERGED_FILE
print '\nMerge SUCCESS!'
Copy link
Collaborator

Choose a reason for hiding this comment

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

我倾向于写一个merge_model.py放到https://github.com/PaddlePaddle/Paddle/tree/develop/python/paddle/utils目录下。merge_model.py可定义def merge_v2_model(net, param_file, out)这样一个接口,而使用这个工具则需要写这样一个run.py

from paddle.utils.merge_model import merge_v2_model
from mobilenet import mobile_net

if __name__ == '__main__':
    net = mobile_net(3*224*224, #input data size
                     102, #class num (flowers 102)
                     1.0 # mobilenet's scale 
                     )   

    param_file = 'mobilenet_flowers102.tar.gz'
                                                                                                                                                                                             
    # the file we generate
    merged_model = 'mobilenet.paddle'
    merge_v2_model(net, param_file, merged_model)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

perfect


merge_v2_model(net, param_file, output_file)

```
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个文件里的内容挪到https://github.com/PaddlePaddle/Mobile/blob/develop/benchmark/tool/C/README.md这里如何?

Copy link
Collaborator

@hedaoyuan hedaoyuan Nov 1, 2017

Choose a reason for hiding this comment

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

单独放在这里也可以,如何将训练后的多个参数文件合并成一个,这个问题关注的人也挺多的。

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK,那在https://github.com/PaddlePaddle/Mobile#deployment-optimization-methods加个链接吧

Run the following code

```
from paddle.util.merge_model import merge_v2_model
Copy link
Collaborator

Choose a reason for hiding this comment

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

A typo: from paddle.utils.merge_model import merge_v2_model

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, i will fix it ASAP

@Xreki
Copy link
Collaborator

Xreki commented Nov 3, 2017

There is another typo in the directory's name: merge_config_paramsters -> merge_config_parameters

@Xreki Xreki merged commit cced3df into PaddlePaddle:develop Nov 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

a paddle_merge_model script is needed
3 participants