TensorFlow安装,国内镜像超快安装

tensorFlow的安装

1.下载安装pip命令

       如果你的主机没有pip命令的话需要进行安装命令操作。

       Pip:apt install python-pip

       pip3:apt install python3-pip

2.安装tensorFlow

       安装tensorFlow的时候直接输入命令

       pip install tensorflow-gpu

       这样安装GPU版本的tensorflow速度非常慢,可以通过定向镜像源来提高下载的速度,我使用的是豆瓣的镜像源。

       pip install tensorflow-gpu -i https://pypi.douban.com/simple

       连接豆瓣的镜像源速度非常的快,但是会报错一个错误:

       ERROR: markdown 3.1.1 has requirement setuptools>=36, but you'll have setuptools 20.7.0 which is incompatible.

       因为pip的版本太低了,所以我们采用:

       pip3 install tensorflow-gpu -i https://pypi.douban.com/simple

       安装即可成功

导入tensorFlow的错误:

错误:ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

原因:tensorFlow版本与cudnn版本不兼容。

解决方案:必须安装tensorflow1.6.0或者往上,我的搭配是:cuda9.0+cudnn7.05+tensorflow 1.6.0 (我是一个一个试出来的,网上的帖子太坑了。)

猜你喜欢

转载自blog.csdn.net/Xu_XiaoXiao_Ji/article/details/90769664