python-3.x - OpenBLAS blas_thread_init:pthread_create:资源暂时不可用
问题描述
我现在面临一个问题,无法在集群中运行任何程序。它给出了错误。
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 64 current, 64 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 64 current, 64 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 64 current, 64 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 64 current, 64 max
Traceback (most recent call last):
File "hello-world.py", line 1, in <module>
from keras.models import Sequential
File "/home/amalli2s/anaconda3/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/amalli2s/anaconda3/lib/python3.6/site-packages/keras/utils/__init__.py", line 2, in <module>
from . import np_utils
File "/home/amalli2s/anaconda3/lib/python3.6/site-packages/keras/utils/np_utils.py", line 6, in <module>
import numpy as np
File "/home/amalli2s/.local/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/home/amalli2s/.local/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/amalli2s/.local/lib/python3.6/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/amalli2s/.local/lib/python3.6/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/amalli2s/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
SystemError: initialization of multiarray raised unreported exception
这个问题,我假设与这个相同Python 的多个实例同时运行限制为 35
所以根据我设置时的解决方案
export OPENBLAS_NUM_THREADS=1
然后我最终得到以下错误:
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
Aborted
是否有其他人面临同样的问题或对如何解决这个问题有想法?谢谢你。
编辑:好的,这似乎是因为管理员试图实施的一些配置限制。现在它又可以工作了。
解决方案
我在 ubuntu 服务器上运行 numpy 时遇到了这个问题。我收到以下所有错误,具体取决于我是尝试在 shell 中导入 numpy 还是运行我的 django 应用程序:
- PyCapsule_Import 无法从
- numpy.core._multiarray_umath 导入(OpenBLAS blas_thread_init:
- 线程 25 的 pthread_create 失败(共 32 个):资源暂时不可用
我发布这个答案,因为它让我发疯。对我有帮助的是添加:
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
前
import numpy as np
我猜服务器对它允许的线程数量有一些限制(?)。希望它可以帮助某人!
推荐阅读
- python - tkinter 布局和 ttk.Notebook 的问题
- python - Django extra-views:有什么方法可以控制它们的显示方式吗?
- java - 如何打印用 Java 排序的数组的所有非空子集?
- node.js - 如何解决节点模块编译中的循环依赖?
- powershell - 从网络上的共享驱动器中导出文件夹列表
- python - google colab 中的 OpenCV 代码导致断言错误
- tensorflow - `predict_step` 的 Keras 模型中禁用了急切执行
- kotlin - Kotlin:比较两个不同大小的不同列表以找到共享值并在发生时更改元素
- java - 如何使用java和android找到两个位置及其经度和纬度之间的公里距离
- reactjs - React 应用程序在子级中没有一致的 redux 提供程序