提交 197d0f24 编写于 作者: T Tao Luo

fix trt_model_tester to pass the ci

test=develop
上级 71d9097a
...@@ -99,24 +99,12 @@ void compare(std::string model_dir, bool use_tensorrt) { ...@@ -99,24 +99,12 @@ void compare(std::string model_dir, bool use_tensorrt) {
SetFakeImageInput(&inputs_all, model_dir, false, "__model__", ""); SetFakeImageInput(&inputs_all, model_dir, false, "__model__", "");
} }
std::vector<PaddleTensor> native_outputs;
NativeConfig native_config;
SetConfig<NativeConfig>(&native_config, model_dir, true, false,
FLAGS_batch_size);
TestOneThreadPrediction(
reinterpret_cast<PaddlePredictor::Config*>(&native_config), inputs_all,
&native_outputs, false);
std::vector<PaddleTensor> analysis_outputs;
contrib::AnalysisConfig analysis_config; contrib::AnalysisConfig analysis_config;
analysis_config.EnableUseGpu(50, 0);
SetConfig<contrib::AnalysisConfig>(&analysis_config, model_dir, true, SetConfig<contrib::AnalysisConfig>(&analysis_config, model_dir, true,
use_tensorrt, FLAGS_batch_size); use_tensorrt, FLAGS_batch_size);
TestOneThreadPrediction( CompareNativeAndAnalysis(
reinterpret_cast<PaddlePredictor::Config*>(&analysis_config), inputs_all, reinterpret_cast<const PaddlePredictor::Config*>(&analysis_config),
&analysis_outputs, true); inputs_all);
CompareResult(native_outputs, analysis_outputs);
} }
TEST(TensorRT_mobilenet, compare) { TEST(TensorRT_mobilenet, compare) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册