Ubuntu install TensorFlow

时间:2023-03-09 08:08:25
Ubuntu install TensorFlow
/********************************************************************************
* Ubuntu install TensorFlow
* 说明:
* TensorFlow Lite好像不久就会发布,尝试一下TensorFlow安装。
*
* 2017-11-22 深圳 龙华樟坑村 曾剑锋
*******************************************************************************/ 一、参考文档:
. 在 Ubuntu 上安装 TensorFlow
https://efeiefei.gitbooks.io/tensorflow_documents_zh/install/install_linux.html
2. Tensorflow教程
https://morvanzhou.github.io/tutorials/machine-learning/tensorflow/
二、Install:
. sudo apt-get install python3-pip python3-dev
. pip3 install tensorflow 三、测试:
zengjf@zengjf:~/zengjf/zengjfos/freeopcua$ python3
Python 3.5.+ (default, Sep , ::)
[GCC 6.2. ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
-- ::18.932106: I tensorflow/core/platform/cpu_feature_guard.cc:] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4. SSE4. AVX AVX2 FMA
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>>