Open levinxo 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!
你好,经过分析,初步判断是新执行器问题,目前尚未定位到具体原因,可先通过设置FLAGS_USE_STANDALONE_EXECUTOR=0使用旧执行器来避免该问题,修复该问题后,我们会尽快回复您。
你好,我们系统分析了jieba+paddle在这个case下的问题,jieba源码中在predict模块中声明了一个paddle的静态图执行器executor,在predict模块的get_result函数中调用该执行器执行,在这个多线程的示例中,由于python的标准import不会对一个模块重复载入,所以只声明了一个执行器,多个线程同时使用该执行器执行,这是无法保证正确性的。 predict模块的代码如下:https://github.com/fxsjy/jieba/blob/master/jieba/lac_small/predict.py ''' import paddle exe = fluid.Executor(place) def get_result(str1): result = exe.run() return result '''
好的,谢谢!目前暂时通过多进程解决此问题
bug描述 Describe the Bug
多线程使用jieba+paddle时,会报各类错误/段错误,MemoryError是其中一种 多进程即multiprocessing下运行是OK的,稳定不报错。
系统为Ubuntu 20.04(docker镜像,cpu下运行) python版本为3.8.10
PIP版本信息: paddlepaddle 2.3.1 jieba 0.42.1
其他补充信息 Additional Supplementary Information
No response