Welcome 微信登录

首页 / 操作系统 / Linux / TensorFlow安装与测试

TensorFlow安装与测试TensorFlow官网:http://tensorflow.org/
安装步骤:
1、sudo apt-get install python-pip python-dev python-virtualenv2、virtualenv --system-site-packages ~/tensorflow3、cd ~/tensorflow4、source bin/activate # If using bash5、(tensorflow)$ pip install --upgrade tensorflow-0.5.0-cp27-none-linux_x86_64.whl测试:1、打开终端输入cd tensorflow2、source bin/activate3、python4、输入python后输入以下示例>>> import tensorflow as tf
>>> hello = tf.constant("Hello, TensorFlow!")
>>> sess = tf.Session()
>>> print sess.run(hello)
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print sess.run(a+b)
42
>>>5、测试成功接下来首先退出python 按快捷键Ctrl+D6、再退出tensorflow 在命令行输入命令:deactivate本文永久更新链接地址