From 10225cbfbe866f17466f2be270a03f2a380374b3 Mon Sep 17 00:00:00 2001 From: liuruilong Date: Wed, 4 Jul 2018 12:03:59 +0800 Subject: [PATCH] fix batch norm crash bug --- src/framework/op_registry.h | 2 -- src/io/loader.cpp | 1 - src/operators/kernel/central-arm-func/batchnorm_arm_func.h | 3 ++- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/framework/op_registry.h b/src/framework/op_registry.h index a76cc7e491..8a7beae993 100644 --- a/src/framework/op_registry.h +++ b/src/framework/op_registry.h @@ -45,7 +45,6 @@ struct OperatorRegistrar : public Registrar { << "OperatorRegistrar should be invoked at least by OpClass"; return; } - printf(" regis ting %s \n", op_type.c_str()); OpInfo info; OperatorRegistrarRecursive(op_type, &info); OpInfoMap::Instance()->Insert(op_type, info); @@ -108,7 +107,6 @@ class OpRegistry { __op_registrar_##op_type##_##device_name(#op_type); \ int TouchOpRegistrar_##op_type##_##device_name() { \ __op_registrar_##op_type##_##device_name.Touch(); \ - printf(" registering !! \n"); \ return 0; \ } diff --git a/src/io/loader.cpp b/src/io/loader.cpp index f3b19abbe1..51e007a6ab 100644 --- a/src/io/loader.cpp +++ b/src/io/loader.cpp @@ -21,7 +21,6 @@ namespace paddle_mobile { using framework::Variable; static size_t ReadBuffer(const char *file_name, uint8_t **out) { - printf("%s \n", file_name); FILE *fp; fp = fopen(file_name, "rb"); PADDLE_MOBILE_ENFORCE(fp != NULL, " %s open failed !", file_name); diff --git a/src/operators/kernel/central-arm-func/batchnorm_arm_func.h b/src/operators/kernel/central-arm-func/batchnorm_arm_func.h index 2845e5f8b7..b2af17eb4a 100644 --- a/src/operators/kernel/central-arm-func/batchnorm_arm_func.h +++ b/src/operators/kernel/central-arm-func/batchnorm_arm_func.h @@ -229,7 +229,7 @@ void BatchnormCompute(const BatchNormParam ¶m) { delete[] inv_std_ptr; } -#endif +#else float *inv_std_ptr = new float[C]; for (int i = 0; i < C; i++) { inv_std_ptr[i] = @@ -260,6 +260,7 @@ void BatchnormCompute(const BatchNormParam ¶m) { } } delete[] inv_std_ptr; +#endif } } // namespace operators -- GitLab