使用c++接口的多线程,报segment fault
Created by: dancingpipi
DLOG(INFO) << "create main_predictor";
std::unique_ptr<paddle::PaddlePredictor> main_predictor = CreatePaddlePredictor(config);
predictors.emplace_back(std::move(main_predictor));
DLOG(INFO) << "create multi predictors";
for (int i = 1; i < multi_threads; ++i){
predictors.emplace_back(std::move(main_predictor->Clone()));
}
DLOG(INFO) << "finish predictors";
这是什么原因啊,无论是CPU还是GPU都不行。 当multi_threads值为1时,可以正常预测