ubuntu14.04安装anaconda2.4.4.0 cuda8.0 cudnn5.1 tensorflow

安装好系统之后首先要先安装显卡驱动

可到NVIDA官网下载所需的显卡版本或者只是用以下代码实现安装

sudo apt-get install nvidia-375

1. 安装anacodna

下载网址:https://www.anaconda.com/download/

sudo bash Anaconda2-4.4.0-Linux-x86_64.sh

如果是anaconda3只需改成相应的版本名称就是了

2. 安装bazel

$ echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
$ curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install bazel
$ sudo apt-get upgrade bazel

3.安装cuda8.0

请到官网下载与自己配置相对应的软件包https://developer.nvidia.com/cuda-downloads

安装代码:

  1. $ sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb
  2. $ sudo apt-get update
  3. $ sudo apt-get install cuda

4. 安装CUDNN(Installing from a Tar File

  1. Navigate to your <installpath> directory containing cuDNN.
  2. Unzip the cuDNN package.
    $ tar -xzvf cudnn-9.0-linux-x64-v7.tgz
  3. Copy the following files into the CUDA Toolkit directory.
    $ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
    $ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
    $ sudo chmod a+r /usr/local/cuda/include/cudnn.h
    /usr/local/cuda/lib64/libcudnn*

5. install tensorflow with Anaconda

  1. Follow the instructions on the Anaconda download site to download and install Anaconda.

  2. Create a conda environment named tensorflow to run a version of Python by invoking the following command:

    $ conda create -n tensorflow
  3. Activate the conda environment by issuing the following command:

    $ source activate tensorflow
     (tensorflow)$  # Your prompt should change 
  4. Issue a command of the following format to install TensorFlow inside your conda environment:

    (tensorflow)$ pip install --ignore-installed --upgrade tfBinaryURL

    where tfBinaryURL is the URL of the TensorFlow Python package. For example, the following command installs the CPU-only version of TensorFlow for Python 3.4:

6. Validate your installation

To validate your TensorFlow installation, do the following:

  1. Ensure that your environment is prepared to run TensorFlow programs.
  2. Run a short TensorFlow program.

Run a short TensorFlow program

Invoke python from your shell as follows:

$ python

Enter the following short program inside the python interactive shell:

# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

If the system outputs the following, then you are ready to begin writingTensorFlow programs:

Hello, TensorFlow!

If you are new to TensorFlow, see Getting Started with TensorFlow.

If the system outputs an error message instead of a greeting, see Commoninstallation problems.




相关链接:https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0/

https://alliseesolutions.wordpress.com/2016/07/05/how-to-install-gpu-tensorflow-0-9-from-sources-ubuntu-14-04/

https://developer.nvidia.com/cuda-downloads

https://www.tensorflow.org/install/

http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installcuda

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#axzz4rgaP0Hm8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值