diff --git a/x2paddle/op_mapper/caffe_op_mapper.py b/x2paddle/op_mapper/caffe_op_mapper.py index 1ec79dd8ec6a264f8b47daa5e300ac1191c4ce98..4283bfecab13437172be4ec3402c4620642509f7 100644 --- a/x2paddle/op_mapper/caffe_op_mapper.py +++ b/x2paddle/op_mapper/caffe_op_mapper.py @@ -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'),