PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.93k stars 1.61k forks source link

libmklml_intel.so 报错 #10490

Open 2776012999 opened 5 months ago

2776012999 commented 5 months ago

   1)Paddle Lite 版本:release v2.9    2)Host 环境:Linux X86    3)运行设备环境:intel i7 6700 32G    4)预测后端信息: Thread 47 "@(���" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff9d7fa640 (LWP 4699)] 0x00007fff8ba3ec17 in mkl_blas_avx2_sgemm_kernel_nocopy_NN_b0 () from /lib/libmklml_intel.so

部分代码: std::string rec_model_file = "./model/lite/ch_PP-OCRv3_rec_slim_opt.nb"; std::string runtime_device = "x86"; std::string precision = "INT8"; std::string num_threads = "1"; std::string batchsize = "1"; std::string dict_path = "./model/lite/ppocr_keys_v1.txt"; std::string config_path = "./model/lite/config.txt";

    auto Config = LoadConfigTxt(config_path);
    int rec_image_height = int(Config["rec_image_height"]);

    auto charactor_dict = ReadDict(dict_path);
    //charactor_dict.insert(charactor_dict.begin(), "#"); // blank char for ctc
    //charactor_dict.push_back(" ");

    auto rec_predictor = loadModel(rec_model_file, std::stoi(num_threads));

    std::shared_ptr<PaddlePredictor> cls_predictor;

    std::vector<double> time_info = {0, 0, 0};

    std::cout << "The predict img: " << fileName << std::endl;
    cv::Mat srcimg = cv::imread(fileName, cv::IMREAD_COLOR);

    if (!srcimg.data) {
        std::cerr << "[ERROR] image read failed! image path: " << fileName << std::endl;
        //exit(1);
        return;
    }

    int width = srcimg.cols;
    int height = srcimg.rows;
    std::vector<int> upper_left = {0, 0};
    std::vector<int> upper_right = {width, 0};
    std::vector<int> lower_right = {width, height};
    std::vector<int> lower_left = {0, height};
    std::vector<std::vector<int>> box = {upper_left, upper_right, lower_right, lower_left};
    std::vector<std::vector<std::vector<int>>> boxes = {box};

    std::vector<std::string> rec_text;
    std::vector<float> rec_text_score;
    std::vector<double> times;
    RunRecModel(boxes, srcimg, rec_predictor, rec_text, rec_text_score,
                charactor_dict, cls_predictor, 0, &times, rec_image_height);

    // print recognized text
    for (int i = 0; i < rec_text.size(); i++) {
        std::cout << i << "\t" << rec_text[i] << "\t" << rec_text_score[i] << std::endl;
    }
    time_info[0] += times[0];
    time_info[1] += times[1];
    time_info[2] += times[2];
lishicheng1996 commented 5 months ago

PaddleLite 版本太老了,建议更新哈~