使用Docker快速安装TF环境:
$ docker search tensorflow
$ docker pull tensorflow/tensorflow
$ docker run -it --rm tensorflow/tensorflow
# python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
运行TF测试样例
进入Docker容器后
# python
>>> import tensorflow as tf
>>> a=tf.constant([1.0,2.0],name="a")
>>> b=tf.constant([2.0,3.0],name="b")
>>> result=a+b
>>> sess=tf.Session()
>>> sess.run(result)