From 85dbe94c8cabe7685c0f43df2d0a6699b209e762 Mon Sep 17 00:00:00 2001 From: SunAhong1993 Date: Tue, 29 Oct 2019 20:23:55 +0800 Subject: [PATCH] fix the prelu --- x2paddle/decoder/caffe_decoder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x2paddle/decoder/caffe_decoder.py b/x2paddle/decoder/caffe_decoder.py index ea9d3bc..dc1d910 100644 --- a/x2paddle/decoder/caffe_decoder.py +++ b/x2paddle/decoder/caffe_decoder.py @@ -243,7 +243,10 @@ class CaffeDecoder(object): for blob in layer.blobs: if len(blob.shape.dim): dims = blob.shape.dim - c_o, c_i, h, w = map(int, [1] * (4 - len(dims)) + list(dims)) + if layer.type == 'PReLU': + c_o, c_i, h, w = map(int, [1] + list(dims) + [1]* (3 - len(dims))) + else: + c_o, c_i, h, w = map(int, [1] * (4 - len(dims)) + list(dims)) else: c_o = blob.num c_i = blob.channels -- GitLab