提交 584aa975 编写于 作者: C channingss

fix the prelu for caffe

上级 32d2ec39
......@@ -467,7 +467,12 @@ class CaffeOpMapper(OpMapper):
data = node.data
assert data is not None, 'The parameter of {} (type is {}) is not set. You need to use python package of caffe to set the default value.'.format(
node.layer_name, node.layer_type)
self.weights[node.layer_name + '_weights'] = data[0]
import paddle
pd_version = paddle.__version__
if pd_version.startswith("1.8.4") or pd_version.startswith("1.8.3"):
self.weights[node.layer_name + '_weights'] = data[0].reshape(1, -1)
else:
self.weights[node.layer_name + '_weights'] = data[0]
attr = {
'mode': string(mode),
'param_attr': string(node.layer_name + '_weights'),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册