PaddleNLP
PaddleNLP copied to clipboard
flask部署 多标签分类模型,单GPU单进程正常,多进程报错
flask部署 多标签分类模型,单GPU单进程正常,多进程报错
python3.8.12 paddlepaddle 2.2 paddlenlp 2.2.4
self.input_handles[0].copy_from_cpu(input_ids) File "/usr/local/python3/lib/python3.8/site-packages/paddle/fluid/inference/wrapper.py", line 35, in tensor_copy_from_cpu self.copy_from_cpu_bind(data) OSError: (External) CUDA error(3), initialization error. [Hint: 'cudaErrorInitializationError'. The API call failed because the CUDA driver and runtime could not be initialized. ] (at /paddle/paddle/fluid/platform/gpu_info.cc:284)
如果使用 CPU 模式,多进程也正常, 使用 GPU 模式,多进程就不正常
如果使用 CPU 模式,多进程也正常, 使用 GPU 模式,多进程就不正常
您好,能不能提供一下具体的部署代码?我们可以线下复现一下问题
解决了吗 我也遇到了这个问题
没有, 一直没有给我回信,后来我就用 paddle serving 部署了
https://stackoverflow.com/questions/22950047/cuda-initialization-error-after-fork cuda使用fork方式多进程有一些问题;可以试下改成PredictorPool的形式来预测,具体可以参考这个例子:https://github.com/PaddlePaddle/Paddle-Inference-Demo/blob/master/python/advanced/multi_thread/threads_demo.py
https://stackoverflow.com/questions/22950047/cuda-initialization-error-after-fork cuda使用fork方式多进程有一些问题;可以试下改成PredictorPool的形式来预测,具体可以参考这个例子:https://github.com/PaddlePaddle/Paddle-Inference-Demo/blob/master/python/advanced/multi_thread/threads_demo.py
谢谢,我试试
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。