Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmklml_intel.so 报错 #10490

Open
2776012999 opened this issue Apr 8, 2024 · 1 comment
Open

libmklml_intel.so 报错 #10490

2776012999 opened this issue Apr 8, 2024 · 1 comment

Comments

@2776012999
Copy link

2776012999 commented Apr 8, 2024

   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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants