From c558f059adfd0f95649f469f031ab7f8a37ebaaa Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Thu, 30 Aug 2018 10:18:03 +0800 Subject: [PATCH] fix --- paddle/fluid/framework/executor.h | 2 ++ paddle/fluid/inference/api/analysis_predictor.cc | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/executor.h b/paddle/fluid/framework/executor.h index 214ca3dc492..f95808c199b 100644 --- a/paddle/fluid/framework/executor.h +++ b/paddle/fluid/framework/executor.h @@ -60,6 +60,7 @@ class Executor { void Run(const ProgramDesc& prog, Scope* scope, int block_id, bool create_local_scope = true, bool create_vars = true); + // This API is very slow. void Run(const ProgramDesc& program, Scope* scope, std::map* feed_targets, std::map* fetch_targets, @@ -79,6 +80,7 @@ class Executor { bool create_local_scope = true, bool create_vars = true, bool keep_kids = false); + // This API is very slow. void RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, std::map* feed_targets, std::map* fetch_targets, diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 0b29b233822..7cdaf4c6a23 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -80,8 +80,7 @@ class AnalysisPredictor : public NativePaddlePredictor { sub_scope_ ? sub_scope_ : scope_.get(), 0); // Get the feed_target_names and fetch_target_names - feed_target_names_ = inference_program_->GetFeedTargetNames(); - fetch_target_names_ = inference_program_->GetFetchTargetNames(); + PrepareFeedFetch(); return true; } -- GitLab