-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
Merge_model().do_merge() | ||
|
||
print 'Generate ', MERGED_FILE | ||
print '\nMerge SUCCESS!' |
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.
我倾向于写一个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)
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.
perfect
|
||
merge_v2_model(net, 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.
这个文件里的内容挪到/~https://github.com/PaddlePaddle/Mobile/blob/develop/benchmark/tool/C/README.md
这里如何?
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.
单独放在这里也可以,如何将训练后的多个参数文件合并成一个,这个问题关注的人也挺多的。
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.
OK,那在/~https://github.com/PaddlePaddle/Mobile#deployment-optimization-methods
加个链接吧
Run the following code | ||
|
||
``` | ||
from paddle.util.merge_model import merge_v2_model |
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.
A typo: from paddle.utils.merge_model import merge_v2_model
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.
ok, i will fix it ASAP
There is another typo in the directory's name: |
fix #19
modify readme in pruning
rename
$Mobile/tool
to$Mobile/tools