小编Har*_*moz的帖子

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", …
Run Code Online (Sandbox Code Playgroud)

python-3.x openblas keras

11
推荐指数
4
解决办法
1万
查看次数

Roc_curve pos_label混淆

roc_curve我有一个与深度学习练习相关的问题scikit-learn,我注意到我的数据有 1 作为正标签。经过我的训练,测试准确率约为 74%,但 roc 曲线下面积 (AUC) 分数仅为 0.24。

y_pred = model.predict([x_test_real[:, 0],x_test_real[:, 1]])
fpr, tpr, thresholds = metrics.roc_curve(y_test_real, y_pred,pos_label=1)
roc_auc = metrics.auc(fpr, tpr)
print("roc_auc:  %0.2f" % roc_auc)
Run Code Online (Sandbox Code Playgroud)

如果我将 更改pos_label为 0。auc 分数变为 0.76(显然)

y_pred = model.predict([x_test_real[:, 0],x_test_real[:, 1]])
fpr, tpr, thresholds = metrics.roc_curve(y_test_real, y_pred,pos_label=0)
roc_auc = metrics.auc(fpr, tpr)
print("roc_auc:  %0.2f" % roc_auc)
Run Code Online (Sandbox Code Playgroud)

现在我做了一个小实验,我改变了我的训练和测试标签(这是二元分类)

y_train_real = 1 - y_train_real
y_test_real = 1 - y_test_real
Run Code Online (Sandbox Code Playgroud)

像这样,这应该将正标签和负标签从 1 翻转到 0。然后我再次运行我的代码。这次预计大鹏 auc 的行为也会发生翻转。但不是!

fpr, tpr, thresholds = metrics.roc_curve(y_test_real, y_pred,pos_label=0) …
Run Code Online (Sandbox Code Playgroud)

python roc scikit-learn deep-learning keras

8
推荐指数
1
解决办法
4258
查看次数

restore_best_weights问题keras提前停止

我正在使用keras的早期学习来完成我的深度学习项目.这里的文件提到了恢复最佳权重的非常有用的想法.但不知怎的,我还没能使用它.我在keras 2.2.2/TF 1.10,从anaconda安装.呼叫很简单如下.有什么问题吗?

es = EarlyStopping(monitor ='val_acc',min_delta = 1e-4,耐心=耐心_,verbose = 1,restore_best_weights = True)

init()得到了一个意外的关键字参数'restore_best_weights'

keras keras-2

7
推荐指数
1
解决办法
4929
查看次数

Tensorflow flatten vs numpy flatten功能对机器学习训练的影响

我开始使用keras和tensorflow深入学习东西.在第一阶段,我感到疑惑.当我使用tf.contrib.layers.flatten(Api 1.8)平整图像时(也可以是多通道).

这与使用numpy的flatten函数有什么不同?这对培训有何影响.我可以看到tf.contrib.layers.flatten比numpy flatten需要更长的时间.它正在做更多的事情吗?

这是一个非常接近的问题,但这里接受的答案包括Theano并没有完全解决我的疑虑.

示例:假设我有一个(10000,2,96,96)形状的训练数据.现在我需要输出(10000,18432)形状.我可以使用tensorflow flatten或使用像numpy flatten这样做

X_reshaped = X_train.reshape(*X_train.shape[:1], -2)
Run Code Online (Sandbox Code Playgroud)

它在培训方面有何不同,哪种方法最佳?

python numpy machine-learning keras tensorflow

5
推荐指数
2
解决办法
1207
查看次数

在 matplotlib 子图之间添加垂直线

我这里有这个子图 你好,我已经制作了这个子图,这里的图像分为 4 列,我的想法是将它们分成两列进行比较,即第一列与第二列、第三列与第四列。但现在看起来有点令人困惑。是否可以在第二列和第三列之间添加一条垂直线?这样看起来前两列是在一起的,而另外两列是成对的?有什么可行的办法吗?

import matplotlib.pyplot as plt

indexes = [1000,1001]

indexes2 = [1010,1011]
columns = 4
rows = len(indexes)
f, axarr = plt.subplots(rows, columns,figsize=(10,10))
k = 0
for i in range(0, rows):
    axarr[i, 0].set_title(str(indexes[k])+"-Patch 1",fontsize=15)    
    axarr[i, 1].set_title(str(indexes[k])+"-Patch 2",fontsize=15)

    axarr[i, 2].set_title(str(indexes2[k])+"-Patch 1",fontsize=15)    
    axarr[i, 3].set_title(str(indexes2[k])+"-Patch 2",fontsize=15)

    k = k+1
    axarr[i, 0].set_xticks([])
    axarr[i, 1].set_xticks([])
    axarr[i, 0].set_yticks([])
    axarr[i, 1].set_yticks([])

    axarr[i, 2].set_xticks([])
    axarr[i, 3].set_xticks([])
    axarr[i, 2].set_yticks([])
    axarr[i, 3].set_yticks([])

plt.tight_layout()
Run Code Online (Sandbox Code Playgroud)

我已经添加了如何获取子图的代码。如果对回答问题有帮助的话。感谢您的时间。:)

如果问题不清楚,我需要这样的一行,我在下图中的图像编辑器中添加了这一行。 带有我需要的线条的图像

python matplotlib

2
推荐指数
1
解决办法
2848
查看次数