ubuntu16.04 安装 tensorflow (cpu 版本)详细可行步骤

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu16.04 安装 tensorflow (cpu 版本)详细可行步骤相关的知识,希望对你有一定的参考价值。

参考技术A

2、 Tensorflow cpu 版本的安装

1、 是pip3(Python3.5版本),不是pip(python2.7版本);
2、输入命令行时,空格会导致输入不正确,得注意;

3、 测试安装成功
1、命令行输入: python
2、继续输入:

重装Anaconda 时,关于卸载Anaconda3的方法:

ubuntu 安装TensorFlow

1.安装pip

$ sudo apt-get install python-pip python-dev

2.安装 TensorFlow for Python 2.7

# Ubuntu/Linux 64-bit, CPU only, Python 2.7:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only:
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl

3. 安装 TensorFlow for Python 3.4

# Ubuntu/Linux 64-bit, CPU only, Python 3.4:
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl

# Mac OS X, CPU only:
$ sudo easy_install --upgrade six
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py3-none-any.whl

备注:如果之前安装过 TensorFlow < 0.7.1 的版本,应该先使用 pip uninstall 卸载 TensorFlow 和 protobuf ,保证获取的是一个最新 protobuf 依赖下的安装包.

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
>>>

 

以上是关于ubuntu16.04 安装 tensorflow (cpu 版本)详细可行步骤的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu16.04安装TensorFlow

怎么在ubuntu 16.04 上安装tensorflow

ubuntu16.04 安装 tensorflow (cpu 版本)详细可行步骤

Ubuntu16.04安装tensorflow+安装opencv+安装openslide+安装搜狗输入法

Ubuntu16.04下 编译安装 Tensorflow

ubuntu16.04 tensorflow pip 方式安装