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") {