Ubuntu14.04下安装Tensorflow遇到的问题
来源:互联网 发布:文字解密软件 编辑:程序博客网 时间:2024/05/22 03:30
安装步骤:
首先说说安装步骤,挺简单的,就是确认pip和Python的版本
pip -V
python
如果不是最新版本就更新一下
$sudo apt-get install python-pip python-dev
然后就是安装Tensorflow了
$pip install tensorflow # Python 2.7; CPU support (no GPU support)
$pip3 install tensorflow # Python 3.n; CPU support (no GPU support)
$pip install tensorflow-gpu # Python 2.7; GPU support
$pip3 install tensorflow-gpu # Python 3.n; GPU support
如果上面的步骤不成功,就使用下面的命令:
$sudo pip install --upgradeTF_PYTHON_URL # Python 2.7
$sudo pip3 install --upgradeTF_PYTHON_URL # Python 3.N
各种版本的下载地址:
Python 2.7
CPU only:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp27-none-linux_x86_64.whl
GPU support:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp27-none-linux_x86_64.whl
Python 3.4
CPU only:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp34-cp34m-linux_x86_64.whl
GPU support:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp34-cp34m-linux_x86_64.whl
Python 3.5
CPU only:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp35-cp35m-linux_x86_64.whl
GPU support:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-linux_x86_64.whl
Python 3.6
CPU only:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp36-cp36m-linux_x86_64.whl
GPU support:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp36-cp36m-linux_x86_64.whl
验证tensorflow是否安装成功
- 启动终端,输入
python
- 输入以下代码:
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
如果输出Hello, TensorFlow!
则代表安装成功。
查看Tensorflow版本:
$ pip show tensorflow
问题:
安装之后测试发现以下问题,搜了很多安装经验,我感觉应该是我之前安装的Tensorflow有冲突,虽然显示安装成功了,运行却出错。试了好多办法都不可行,无奈我把Ubuntu重新装了一下,一切就正常了。
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 104, in <module>
from tensorflow.python.platform import test
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/test.py", line 53, in <module>
import mock # pylint: disable=g-import-not-at-top,unused-import
File "/usr/local/lib/python2.7/dist-packages/mock/__init__.py", line 2, in <module>
import mock.mock as _mock
File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 69, in <module>
from pbr.version import VersionInfo
ImportError: No module named pbr.version
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
ImportError: cannot import name pywrap_tensorflow
- Ubuntu14.04下安装Tensorflow遇到的问题
- ubuntu14 上安装tensorflow 遇到的问题
- ubuntu14.04安装tensorflow遇到的坑
- Ubuntu下Tensorflow安装遇到的问题
- Ubuntu14.04下安装TensorFlow
- ubuntu14.04安装matlab2010遇到的问题
- Ubuntu16.04安装tensorflow遇到的问题
- ubuntu14.04+cuda8.0(gtx1080)下tensorflow的安装
- ubuntu14.04下安装boost.python 遇到问题
- 安装tensorflow遇到的问题
- 安装Tensorflow遇到的问题
- Ubuntu14.04下源码安装tensorflow 0.12
- Ubuntu下安装tensorFlow遇到的问题和解决方案
- Win10 下安装 TensorFlow 遇到的一些问题
- ubuntu14.04下安装反向代理工具nginx遇到的问题
- ubuntu14.04安装DevStack与遇到的的问题记录
- Ubuntu14.04 安装 tensorflow
- ubuntu14.04安装TensorFlow
- Elasticsearch 架构原理
- = == === != !==的区别
- mysql 中的事务
- 总结遍历List时删除元素
- 【RabbitMQ】三种Exchange模式——订阅、路由、通配符模式
- Ubuntu14.04下安装Tensorflow遇到的问题
- 单例模式的几种写法(包含双检锁写法)
- POJ 3694 Network(Tarjan求割边+LCA)
- c++运算符重载
- C++ 操作EXCEL(OLE/COM)
- extract-text-webpack-plugin 的安装及配置
- ActiveMQ与Kafka对比
- android android-async-http https
- 树分块——BZOJ1086/Luogu2325 [SCOI2005]王室联邦