TensorFlow安装与测试
TensorFlow安装与测试
TensorFlow官网:http://tensorflow.org/
安装步骤:
1、sudo apt-get install Python-pip python-dev python-virtualenv
2、virtualenv --system-site-packages ~/tensorflow
3、cd ~/tensorflow
4、source bin/activate # If using bash
5、(tensorflow)$ pip install --upgrade tensorflow-0.5.0-cp27-none-linux_x86_64.whl
测试:
1、打开终端输入cd tensorflow
2、source bin/activate
3、python
4、输入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+D
6、再退出tensorflow 在命令行输入命令:deactivate
相关推荐
  Micusd    2020-11-19  
   lybbb    2020-10-15  
   lybbb    2020-09-29  
   ghjk0    2020-09-24  
   yamaxifeng    2020-09-09  
   GDGYZL    2020-08-28  
   lybbb    2020-08-28  
   Icevivian    2020-08-25  
   comwayLi    2020-08-16  
   carbon0    2020-08-16  
   源式羽语    2020-08-09  
   sherry颖    2020-08-01  
   songbinxu    2020-07-19  
   sherry颖    2020-07-18  
   Niteowl    2020-07-15  
   Kindle君    2020-07-15  
   源式羽语    2020-07-04  
   源式羽语    2020-06-28  
 