docker里面使用plt保存图片
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
...
plt.scatter(train_X, train_y,c='r',marker='o')
plt.plot(train_X, sess.run(W) * train_X + sess.run(b))
plt.savefig('plt.png')
# plt.show()
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
...
plt.scatter(train_X, train_y,c='r',marker='o')
plt.plot(train_X, sess.run(W) * train_X + sess.run(b))
plt.savefig('plt.png')
# plt.show()