jupyter tensorflow配置
Anaconda安装
tensorflow
- 按照官网安装即可
- 使用时需要source activate tensorflow
windows防火墙配置
jupyter配置
本地找不到kernel的问题
最终的使用步骤
- 激活tf环境:source activate tensorflow
- 启动notebook:jupyter notebook
- 在本地登录服务器的地址以及对应端口即可
- 关闭tf环境:source deactivate tensorflow
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import warnings
warnings.filterwarnings("ignore")
a = tf.constant( np.ones((3,2)) )
b = tf.constant( np.ones((2,3)) )
sess = tf.Session()
c = sess.run( tf.matmul(a,b) )
print(c)
plt.plot( np.random.rand(20,1) )
plt.show()
[[2. 2. 2.]
[2. 2. 2.]
[2. 2. 2.]]