提交 8159c763 编写于 作者: L liuruilong

fix crash

上级 89dbfc8f
...@@ -66,11 +66,11 @@ class FusionConvAddOp : public framework::OperatorWithKernel< ...@@ -66,11 +66,11 @@ class FusionConvAddOp : public framework::OperatorWithKernel<
#ifdef PADDLE_MOBILE_CPU #ifdef PADDLE_MOBILE_CPU
//#ifndef CONV_ADD_REGISTER #ifndef CONV_ADD_REGISTER
// static framework::FusionOpRegistrar convadd_registrar( static framework::FusionOpRegistrar convadd_registrar(
// new FusionConvAddMatcher()); new FusionConvAddMatcher());
//#define CONV_ADD_REGISTER #define CONV_ADD_REGISTER
//#endif #endif
#endif #endif
......
...@@ -630,7 +630,7 @@ class MultiClassNMSParam : public OpParam { ...@@ -630,7 +630,7 @@ class MultiClassNMSParam : public OpParam {
class FeedParam : public OpParam { class FeedParam : public OpParam {
public: public:
FeedParam(const VariableNameMap &inputs, const VariableNameMap &outputs, FeedParam(const VariableNameMap &inputs, const VariableNameMap &outputs,
const AttributeMap &attrs, Scope scope) { const AttributeMap &attrs, Scope &scope) {
input_x_ = InputXFrom<LoDTensor>(inputs, scope); input_x_ = InputXFrom<LoDTensor>(inputs, scope);
out_ = OutFrom<LoDTensor>(outputs, scope); out_ = OutFrom<LoDTensor>(outputs, scope);
auto var = scope.Var("batch_size"); auto var = scope.Var("batch_size");
......
...@@ -12,19 +12,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -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 See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include <fstream> #include <iostream>
#include "../test_helper.h" #include "../test_helper.h"
#include "../test_include.h" #include "../test_include.h"
int main() { int main() {
paddle_mobile::PaddleMobile<paddle_mobile::CPU> paddle_mobile; paddle_mobile::PaddleMobile<paddle_mobile::CPU> paddle_mobile;
auto time1 = time(); auto time1 = time();
// auto isok = paddle_mobile.Load(g_mobilenet_ssd_gesture + "/model", // auto isok = paddle_mobile.Load(g_mobilenet_ssd_gesture + "/model",
// g_mobilenet_ssd_gesture + "/params", true); // g_mobilenet_ssd_gesture + "/params", true);
auto isok = paddle_mobile.Load(g_mobilenet_ssd, false); auto isok = paddle_mobile.Load(g_mobilenet_ssd, false);
if (isok) { if (isok) {
auto time2 = time(); auto time2 = time();
DLOG << "load cost :" << time_diff(time1, time1) << "ms"; std::cout << "load cost :" << time_diff(time1, time2) << "ms" << std::endl;
std::vector<int64_t> dims{1, 3, 300, 300}; std::vector<int64_t> dims{1, 3, 300, 300};
Tensor input_tensor; Tensor input_tensor;
...@@ -36,7 +36,7 @@ int main() { ...@@ -36,7 +36,7 @@ int main() {
auto time3 = time(); auto time3 = time();
paddle_mobile.Predict(input, dims); paddle_mobile.Predict(input, dims);
auto time4 = time(); auto time4 = time();
DLOG << "predict cost :" << time_diff(time3, time4) << "ms"; std::cout << "predict cost :" << time_diff(time3, time4) << "ms" << std::endl;
} }
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册