【发布时间】:2020-07-02 08:12:06
【问题描述】:
我正在尝试在 google colab 中绘制图表
fig = plt.figure()
plt.title("Weight matrices after model trained")
plt.subplot(1, 3, 1)
plt.title("Trained model Weights")
ax = sns.violinplot(y=h1_w,color='b')
plt.xlabel('Hidden Layer 1')
plt.subplot(1, 3, 2)
plt.title("Trained model Weights")
ax = sns.violinplot(y=h2_w, color='r')
plt.xlabel('Hidden Layer 2 ')
plt.subplot(1, 3, 3)
plt.title("Trained model Weights")
ax = sns.violinplot(y=out_w,color='y')
plt.xlabel('Output Layer ')
plt.show()
该图没有被绘制并且它还显示一个警告 - /usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:8: RuntimeWarning: 超过 20 个数字已打开。通过 pyplot 接口 (matplotlib.pyplot.figure) 创建的图形会一直保留到显式关闭,并且可能会消耗太多内存。 (要控制此警告,请参阅 rcParam figure.max_open_warning)。
如何解决这个问题
【问题讨论】:
-
现在,警告已被删除。但仍然没有绘制图表。 plt.show() 命令后没有显示任何内容
标签: python matplotlib google-colaboratory