The trip data mining - Start Tensorflow-gpu (Win10) from installation

0 Preface

   Since the research direction and guidance of a personal hobby, was put on data mining of no return. Before contact with in everyday school life have more knowledge of data mining, and later to even expand the depth of learning to learn, but mostly based on MATLAB implementation. The Tensorflow learning poorly understood, and after graduation, there are few companies will develop as MATLAB software. So, I embarked on a study of the Tensorflow.

Introduction 1. Tensorflow of

   Tensorflow There are two versions, one is CPU version, one is the GPU version. CPU version of the installation is relatively simple, this version only uses CPU. But when you learn the depth of the neural network, the training will be the face of large-scale networks or large-scale data, this time version of GPU performance will be much better.

2. Tensorflow-GPU version of the installation

   When installing Tensorflow-GPU version are the following steps:

2.1 Anaconda installation

   Anaconda Python library built hundreds of commonly used, many of which still rely Tensorflow library. It is the best of the Python scientific computing environment. So the use of Anaconda as Tensorflow the Python environment. Because before I have to use Python and Anaconda involved in the project, so the Anaconda installation will not repeat them. You can go to the official website to download the corresponding version of the system, and has been the "Next" button. During the following steps, please review with the problem between several software Tensorflow official website.

2.2 CUDA installation

   Tensorflow-GPU CUDA version only supports better, and CUDA is NVIDIA introduced the use of GPU resources for general-purpose computing SDK, its installation package generally integrated graphics driver. Therefore, we need a hardware facility NVIDIA graphics card.

   NVIDIAi equipment after a good graphics card, you can go to the official website to download CUDA.
https://developer.nvidia.com/cuda-downloads

   After the download is complete, install, and Next. After the installation is complete, the "bin" directory under the installation CUDA and "lib \ x64" added to the Path environment variable

   This computer system settings → Advanced → Environment Variables → Path (looking in the system variables in Figure 1.1) → Edit → View → find the corresponding files can be added.

1.1 Path schematic FIG.

2.3 cuDNN installation

   cuDNN is NVODIA launch depth study highly optimized implementation of RNN and CNN. At present, most of the deep learning framework uses cuDNN GPU computing to drive. You can go to the official website to download cuDNN.
https://developer.nvidia.com/rdp/cudnn-download

   Extracting archive, the compressed package bin, include, lib files are copied into C: \ Program Files \ corresponding to \ under the CUDA Toolkit \ v8.0 directory NVIDIA GPU Computing directory

   The C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ extras \ CUPTI \ libx64 \ cupti64_80.dll copied into C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ bin in.

2.4 Tensorflow installation

   Tensorflow installation using Anaconda Prompt, if you need to install CPU version before first delete the version. With "pip uninstall tensorflow", as shown below:

FIG schematic unloading 1.2 TensorFlow

   After the uninstall is complete, generally carried out using tensorflow-gpu mounting "pip install tensorflow-gpu", but generally the use of foreign source download, speed will be very slow. It can be corrected as domestic source download mirror pip, pip mirror source commonly used in domestic include:
(1) Ali cloud: http://mirrors.aliyun.com/pypi/simple/
(2) watercress: HTTP: // pypi .douban.com / the Simple /
(3) Tsinghua University: http://pypi.tuna.tsinghua.edu.cn/simple/
(4) China University of Science and technology: http://pypi.mirrors.ustc.edu.cn / simple /

   Tsinghua University, for example, the specific code as: "the install --index PIP-URL http://pypi.tuna.tsinghua.edu.cn/simple tensorflow-GPU", as shown below:

FIG mirror source 1.3 through domestic installation diagram TensorFlow-gpu

   Then you can wait for the completion of the installation, if the installation went smoothly, you can intervene "import tensorflow as tf" check for correct installation in Python. Should the installation process is not successful, see Section 3 of the problem summary.

3. Tensorflow-GPU version of the problems occurred during installation

   I had wanted to record what problems arise during the installation process, you and me in a timely manner to facilitate viewing in the future when there is need. But unfortunately, in the middle there is a computer situation, led to some records before all gone, so the installation process can only issue a recall from memory. Brother also appear during the installation problem on the investigation Baidu and Google, which at least on my computer is realized. Should it not be achieved, but also hope you more to ask Baidu and Google, after all, their own way is the best. Ha ha ha ha ~

   Acquisition and installation Tensorflow process in the Prompt, the first problem is that "You should consider upgrading via the 'python -m pip install --upgrade pip' command.", Asked me to upgrade pip, this can follow the prompts to enter " python -m pip install --upgrade pip "

   But after this command is executed, and the error. The second problem is the emergence of "typeerror parse () got an unexpected keyword argument transport_encoding".
   There are three methods, but I'm only the third for me to be effective, have to write for your reference.
(. 1) -C Conda the install Anaconda html5lib
(2) the install Conda PIP
(. 3) Found C: \ Users \ Administrator \ Anaconda3 \ Lib \ site-packages \ pip \ index.py file, it opens the Python, found 730 OK the "transport_encoding = encoding", comment it out and save it. Whereby the entire process Tensorflow no problem.

   However, the problem did not end there. When I type "impor tensorflow as tf" in the Spyder, the two-Cheese Li actually has the error. Unfortunately, this is the third question I really have forgotten, like "ImportError: numpy.core.multiarray failed to import". In order not to make misleading and can only be destined to the record.

   To conclude, Tensorflow-gpu installation is time-consuming, and very bothered. Since the choice into the pit, or to uphold the New Year persist, refueling ~ ~

Released five original articles · won praise 0 · Views 335

Guess you like

Origin blog.csdn.net/lybch1/article/details/83097139