Open zwjwhxz opened 1 year ago
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
您好,能具体描述下如何使用的吗,具体的模型,使用的命令及运行环境等等。
您好: 当前是使用paddleOCR封装了一个图片文本提取的C接口, int extract_content_from_image_by_paddleocr(const char img_file, std::string &textcontent,const char model_data_dir) { std::vector<string> sl; if( check_ch_ppocr_infer_config(model_data_dir,sl) ) return -1;
if ( !Utility::PathExists(string(img_file)) ) return -1;
std::vector<cv::String> cv_all_img_names; cv_all_img_names.push_back(cv::String(img_file));
PPOCR ocr = PPOCR(sl);
std::vector<std::vector<OCRPredictResult>> ocr_results = ocr.ocr(cv_all_img_names, FLAGS_det, FLAGS_rec, FLAGS_cls); if( ocr_results.size() == 0 ) return -1;
return copy_result_string(ocr_results[0], textcontent ); }
然后业务程序启用多线程,每个线程绑定设定的CPU核,调用改接口进行文本提取;绑核方式:
运行过程发现,当前运行测试设置的10个线程,运行过程发现,在提取图片的时候,CPU都分配到一个核上了,没有起到多线程绑核的效果。
运行环境: Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal
CPU:Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz;32核 内存:96G
谢谢!
------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/Paddle" @.>; 发送时间: 2022年9月9日(星期五) 下午2:56 @.>; @.**@.>; 主题: Re: [PaddlePaddle/Paddle] 业务绑定CPU后调用paddleocr后,绑核失效,都跑到一个CPU核上了,请问如何进行绑核? (Issue #45864)
您好,能具体描述下如何使用的吗,具体的模型,使用的命令及运行环境等等。
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
封装接口如下:
int extract_content(const char img_file, std::string &textcontent,const char model_data_dir)
{
std::vector
if ( !Utility::PathExists(string(img_file)) )
return -1;
std::vector<cv::String> cv_all_img_names;
cv_all_img_names.push_back(cv::String(img_file));
PPOCR ocr = PPOCR(sl);
std::vector<std::vector<OCRPredictResult>> ocr_results = ocr.ocr(cv_all_img_names, FLAGS_det, FLAGS_rec, FLAGS_cls);
if( ocr_results.size() == 0 )
return -1;
return copy_result_string(ocr_results[0], textcontent );
}
遇到同样的问题,在执行input_t->CopyFromCpu(input.data());时会导致CPU绑核失效
请问有人知道怎么解决这个问题吗?
请提出你的问题 Please ask your question
业务绑定CPU后调用paddleocr后,绑核失效,都跑到一个CPU核上了,请问如何进行绑核?