From 8159c76387bda8d554bc6512bee21fbc73a45829 Mon Sep 17 00:00:00 2001 From: liuruilong Date: Wed, 18 Jul 2018 20:05:51 +0800 Subject: [PATCH] fix crash --- src/operators/fusion_conv_add.h | 10 +++++----- src/operators/op_param.h | 2 +- test/net/test_mobilenet+ssd.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/operators/fusion_conv_add.h b/src/operators/fusion_conv_add.h index fd63efa8f6..4cfd85e476 100644 --- a/src/operators/fusion_conv_add.h +++ b/src/operators/fusion_conv_add.h @@ -66,11 +66,11 @@ class FusionConvAddOp : public framework::OperatorWithKernel< #ifdef PADDLE_MOBILE_CPU -//#ifndef CONV_ADD_REGISTER -// static framework::FusionOpRegistrar convadd_registrar( -// new FusionConvAddMatcher()); -//#define CONV_ADD_REGISTER -//#endif +#ifndef CONV_ADD_REGISTER + static framework::FusionOpRegistrar convadd_registrar( + new FusionConvAddMatcher()); +#define CONV_ADD_REGISTER +#endif #endif diff --git a/src/operators/op_param.h b/src/operators/op_param.h index d75236831f..4b95ceb187 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -630,7 +630,7 @@ class MultiClassNMSParam : public OpParam { class FeedParam : public OpParam { public: FeedParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, Scope scope) { + const AttributeMap &attrs, Scope &scope) { input_x_ = InputXFrom(inputs, scope); out_ = OutFrom(outputs, scope); auto var = scope.Var("batch_size"); diff --git a/test/net/test_mobilenet+ssd.cpp b/test/net/test_mobilenet+ssd.cpp index 1cc17e4299..7218d681d8 100644 --- a/test/net/test_mobilenet+ssd.cpp +++ b/test/net/test_mobilenet+ssd.cpp @@ -12,19 +12,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include +#include #include "../test_helper.h" #include "../test_include.h" int main() { paddle_mobile::PaddleMobile paddle_mobile; auto time1 = time(); - // auto isok = paddle_mobile.Load(g_mobilenet_ssd_gesture + "/model", - // g_mobilenet_ssd_gesture + "/params", true); +// auto isok = paddle_mobile.Load(g_mobilenet_ssd_gesture + "/model", +// g_mobilenet_ssd_gesture + "/params", true); auto isok = paddle_mobile.Load(g_mobilenet_ssd, false); if (isok) { auto time2 = time(); - DLOG << "load cost :" << time_diff(time1, time1) << "ms"; + std::cout << "load cost :" << time_diff(time1, time2) << "ms" << std::endl; std::vector dims{1, 3, 300, 300}; Tensor input_tensor; @@ -36,7 +36,7 @@ int main() { auto time3 = time(); paddle_mobile.Predict(input, dims); auto time4 = time(); - DLOG << "predict cost :" << time_diff(time3, time4) << "ms"; + std::cout << "predict cost :" << time_diff(time3, time4) << "ms" << std::endl; } return 0; } -- GitLab