From 96aa5d61af1c4df08424e42e7e082da96326236a Mon Sep 17 00:00:00 2001 From: nihuini Date: Wed, 22 Nov 2017 16:40:36 +0800 Subject: [PATCH] do not print relu negative slope if it is zero --- tools/caffe/caffe2ncnn.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/caffe/caffe2ncnn.cpp b/tools/caffe/caffe2ncnn.cpp index 2773ea820..4331d93fd 100644 --- a/tools/caffe/caffe2ncnn.cpp +++ b/tools/caffe/caffe2ncnn.cpp @@ -932,7 +932,10 @@ int main(int argc, char** argv) else if (layer.type() == "ReLU") { const caffe::ReLUParameter& relu_param = layer.relu_param(); - fprintf(pp, " 0=%f", relu_param.negative_slope()); + if (relu_param.has_negative_slope()) + { + fprintf(pp, " 0=%f", relu_param.negative_slope()); + } } else if (layer.type() == "Reshape") {