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

来源:互联网 发布:开淘宝店怎么找厂家 编辑:程序博客网 时间:2024/05/22 11:56

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

可到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:

# Pythonimport tensorflow as tfhello = 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
原创粉丝点击