-
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
V2 API save and load param header #3619
Conversation
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.
有点疑问,请帮忙解答下
@@ -34,7 +34,7 @@ def __init__(self, output_layer, parameters): | |||
val = param.getBuf(api.PARAMETER_VALUE) | |||
name = param.getName() | |||
assert isinstance(val, api.Vector) | |||
val.copyFromNumpyArray(parameters.get(name).flatten()) | |||
val.copyFromNumpyArray(parameters.get(name)[1].flatten()) |
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.
这里为什么需要改动inference的code?那么Training的时候也需要改吗?
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.
因为原来:value = parameter.get(name)
现在:header, value = parameter.get(name)
Training
的时候,改在parameters.py
里面了
@@ -43,7 +43,7 @@ def test_serialization(self): | |||
params.__append_config__(__rand_param_config__("param_1")) | |||
|
|||
for name in params.names(): | |||
param = params.get(name) | |||
param = params.get(name)[1] |
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.
这里只测试了[1],有没有办法也测试[0]的值?代表的是header的值对吧
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.
[0]代表header的值。这里header默认都是0,所以都没做测试。可以等以后mkldnn的header进来,再另加一个单测。
在我本地机器上测试了下。 LGTM |
related #3571
fix #3519
Test successfully on book/01.fit_a_line.