Ubuntu 安装tensorflow

pip依赖包安装

安装pip依赖包 https://shimo.im/docs/382ecc509b0f446f


安装好pip之后

更新下,sudo apt-get update

然后安装tensorflow

输入 :cpu版本

pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

gpu版本

pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl


设置环境变量

输入:export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"

export CUDA_HOME=/usr/local/cuda^C


运行tensorflow

打开终端,运行python


$python


Python 2.7.12 (default, Nov 12 2018, 14:36:49) 

[GCC 5.4.0 20160609] on linux2

Type "help", "copyright", "credits" or "license" for more information.


>>> import tensorflow as tf

>>> hello = tf.constant('Hello,TensorFlow!')

>>> sess = tf.Session()

I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 2

I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 2

>>> print sess.run(hello)

Hello,TensorFlow!

>>> a = tf.constant(10)

>>> b = tf.constant(32)

>>> print sess.run(a*b)

320

>>> 



完成。(注:安装时保持网络稳定最好)


此上为我实例安装

有需要可加微信收费安装,不成功不收费。    (20元)

Ubuntu单双系统安装 (30元)

Ubuntu 安装tensorflow_第1张图片

你可能感兴趣的:(Ubuntu 安装tensorflow)