Install tensorflow1.0.0-gpu in linux virtual environment

In order to run a tensorflow program, you need to install version 1.0 of tensorflow. Then you must install cuda8.0, cudnn5.0 and python3.6. Because other versions always report errors.

I have already installed cuda8.0 and cudnn5.0, so you can download them directly, put them in a directory, and modify .bashrc. Which directory to put in, how to modify .bashrc will be mentioned below. Finally, install tensorflow1.0.0. There may be more steps, but step by step is no problem.

(Link: https://pan.baidu.com/s/1mUzm3s-6asEawtKEIjUexQ 
extraction code: 1234)

1. First create a virtual environment

conda create -n tf1.0 python=3.6

2. Enter this environment

source activate tf1.0

3. Find the location where the virtual environment is installed. My location here is:

4. Enter the directory of this virtual environment, which is tf.10. This is the directory we want to put.

cd tf1.0

5. Put the downloaded folder cu8.0 under tf1.0

6. Modify .bashrc, add the 3 lines of code in the red box, then save and exit. Don't forget to source .bashrc

Check whether it is successful:

nvcc --version

7. Install tensorflow1.0.0

pip install tensorflow-gpu==1.0.0

test:

The above steps are effective.


ps: The cuda version of the system itself is cuda9.0. So every time I switch between different versions of cuda, I remove the three new lines in .bashrc. It feels very troublesome. If anyone knows a more convenient way to switch, please give pointers.

 

Guess you like

Origin blog.csdn.net/Answer3664/article/details/107726355