Win10 + python3.6 + VSCode + tensorflow-gpu + keras + cuda8 + cuDN6N environment configuration, win10cudn6n
Preface:
Before getting started, I knew almost nothing about python or tensorflow, so I took a lot of detours When configuring this environment, it took a whole week to complete the environment... However, the most annoying thing is that it is difficult to set up the environment. Because my laptop is low in configuration, the program provided by the teacher cannot run.
There are many blogs for reference in this environment, but I haven't succeeded in it for a long time. It is arrogant to reflect on myself. In the tutorial, we used python3.5, But I installed python3.6. In the tutorial, we talked about installing cuda8. I found that cuda9 was installed on the official website and 9 was not easy to succeed. Most of the files and installation packages required in this article, and the reference blog will provide links at the end.
If you have read other tutorials, check whether the installation is successful:
1. compatibility issues
Python3.6 + cuda8 + cuDNN6
Python3.5 + cuda8 + cuDNN5.1
This is a compatible combination I have found. In the python3.6 combination, there is no need for Micrsolft Visual C ++ 2015 Redistributable. What is needed is Micrsolft Visual C ++ 2017 Redistributable. Currently, the latest version of cuda is 9, but I have not successfully referenced it with python3.6.
2. installation and configuration of cuda + cuDNN
Before installation, you must determine whether your video card is a megada video card or supports cuda. Otherwise, you can only run the program with a solid cpu. If the cuda installation is normal, you only need to click it one step at a time. At the very beginning, the installation of cuda9 on my computer will fail, but I don't know why, if the installation will fail during the installation process, you can choose to customize the installation and select only cuda-related components. If you do not select other components, there will be no problem, the environment variables do not need to be modified. They are all modified.
It is not possible to install cuda only, but not cuDNN. Download the corresponding version of cuDNN, decompress the package, and place the corresponding file in the corresponding folder under the cuda installation directory, the installation directory of cuda can be found by viewing the environment variables.
3. tensorflow-gpu Installation
Tensorflow installation is actually very simple
Supports cuda: Open cmd and enter pip install tensorflow-gpu
Cuda is not supported: Open cmd and enter pip install tensorflow
Note that you only need to install one tensorflow and tensorflow-gpu.
4. keras Installation
The installation of keras is a little complicated. If you directly press pip install keras, errors will be reported (you cannot understand what it means ). You need to manually download two packages, sripy and numpy + mkl (the link will be provided at the end of the article ).
4. 1 install munpy + mkl first
Enter the absolute path address of pip install munpy + mkl in cmd to install the SDK. You can right-click to open the properties of the file. The installation tab contains an object name, which can be copied directly.
Install scipy after 4 or 2
Install scipy in the same way
4, 3 install keras
Then run cmd.
Pip install keras
No problem
5. Use of VScode
There is nothing to talk about during installation. Just click the wizard and click OK. Here we will explain why VScode is used. The first is speed. VS2017 also supports python and has powerful functions, however, the speed is too slow. In addition, VScode can debug python programs, just like debugging C Programs. It is very comfortable to use without configuration and directly uses the python environment of the local machine.
1. Install CUDA and cuDNN
1. Material Preparation
1, 2 Installation Process
1, 3 Verification
Ii. python3.6 + tensorflow-gpu + keras
2, 1 material preparation
2. 2 Installation Process
2, 3 Verification
3. Install VSCode
3, 1 material preparation
3, 2 Installation Process
3, 3 Verification
Download link:
Python https://www.python.org/downloads/
VSCode https://code.visualstudio.com/Download
Cuda 8 http://pan.baidu.com/s/1dFIpsfn cuda https://developer.nvidia.com/cuda-toolkit-archive
CuDNN v6.0 http://pan.baidu.com/s/1jIf53vC cdDNN 5.1 http://pan.baidu.com/s/1cpVhYA
Numpy + mkl http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# numpy python3.5 http://pan.baidu.com/s/1cpVhZS python3.6 http://pan.baidu.com/s/1pLV2aYR
Scipy http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# scipy python3.5 http://pan.baidu.com/s/1miLyOEs python 3.6 http://pan.baidu.com/s/1qXRgg4O
(To be continued)
Interested friends welcome to learn together communication: sr_john_green@outlook.com