测试环境:Ubuntu16LTS+anaconda3+Python 3.5.0+GCC 4.4.7
步骤:
1. 进入anaconda3安装目录下的bin路径;
2. 激活tensorflow,输入source activate tensorflow;
正常情况会显示(tensorflow) root@fly-virtual-machine:~/anaconda3/bin#
3. 进入python交互式编程环境,输入python
4. 测试TensorFlow环境
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>>
5.退出python环境,输入quit();
6. 退出tensorflow,输入source deactivate;