win10-anaconda2-theano-cuda7.5-vs2013

Source: Internet
Author: User
Tags theano nvcc keras

Two days of tossing and turning, finally a spark found the wrong.

First of all, I configured the GPU and CUDNN version of Caffe under Win10. But because of the limit of the win platform, Caffe is not comfortable enough. Because before used for a while Theano, although very slow, but flexible ah, so the spear point to Theano.

Theano CPU version installation is easy, the mainstream method is the use of anaconda, convenient and quick.

This article mainly introduces oneself to engage in GPU and other people configuration when the pit, hope you can avoid.

1. file. Theanorc.txt

Here's a stupid mistake. The Win10 suffix is hidden because the Win7 suffix name is not hidden, so since Theano was installed on WIN10, this file is equivalent to being named by me . Theanorc.txt.txt So I've been using the CPU for one months. The key I didn't know the file format is wrong, and think of the fear pole. Positive solution:

2. Cuda version

Before installing Caffe, I installed is cuda8, because my ignorance, think the problem appeared in Cuda, the Cuda unloading, loaded on the cuda7.5. Here are some of the mistakes I've encountered (intercepted from the reference blog, because I don't want to be in the wrong configuration to demonstrate, heartache). ):

Well, the mistake of this picture is the mistake I've been having, and the main mistake is the red line.

My fault arises in the following: '--compiler-bindir ' C:Program files<x86>\microsoft Visual Studio 12.0\vc\bin '. This compiler bindir to interpret it as a compiled directory

Because my path is only: Microsoft Visual Studio 11.0

In the. theanorc.txt file you need to write the NVCC compilation directory, so the online 99% tutorial is compoler_bindir=c:program files (x86) \microsoft Visual Studio 12.0\vc\ Bin

So I wrote in my own. theanorc.txt file: Compoler_bindir=c:program files (x86) \microsoft Visual Studio 11.0\vc\bin

So it's never going to be right! There has been an error finding the vcvars64.bat file. So I just follow the blogger's journey to find another blogger and another blogger, according to them, downloaded the Vcforpython27.msi file, also configured the path, also found the Vcvars64.bat file, copy it to the C:Program files (x86) \microsoft Visual Studio 11.0\vc\bin, but also reported cannot find the Vcvars64 file. Until I was lucky enough to meet another blogger, the path in his article was so different: Compiler_bindir = D:\software\VS2013\VC\bin. What do I want to do under the VS installation path??? I opened my own vs installation path and found that there are vcvars64.bat files!!! I seem to understand what, this path is suitable for their own! Of course, why am I so sure of it? Because I see this picture:

Figure 1: cuda7.5 support WIN10, Figure 2: cuda7.5 in VS2013 compiler is Visual C + + 12.0, mentioned above, I did not find in the C drive, so I am sure this compiler_bindir must be this:

OK, pycharm test the gpu.test:

At this time my. Theanorc.txt is such a drop:

Run the official website test GPU Example:

Finally, we have the GPU information!  But there are some things that are not harmonious: Cnmem is disabled, and CuDNN not availabel. That means CUDNN is not yet available, of course I have not configured it yet.

However, there are several ways to eliminate other discordant information: Join [Lib] cnmen=0.8 and Allow_input_downcast=true

Look at the results:

That's right! There are no errors or bugs. Is that CDNN is useless.

Note that you cannot write directly in the. Theanorc.txt: OPTIMIZER_INCLUDING=CUDNN, the following error will appear: There is a line: reason=cnmem_status_out_of_memory

It should mean that the CNMEM initialization setting is too large to exceed the memory state! So in the. THEANORC Note Set cnmem=0.8, if you also prompt memory is not enough to go to the small setting, the smaller the memory ratio less.

There is also a small hint behind the error: You can also set the Optimizer=fast_compile in. Theanorc, or Optimizer=none, which also allows the program to run correctly.

3. Configure CUDNN

After downloading the CUDNN, you will find a folder named Cuda with three files: Lib,include,bin. Copy these three files to the Cuda installation directory for overwrite replacement:

Replace Cuda original three folders, then run the GPU test program, you will find even cudnn not avaliable also disappeared. Perfect.

Another: thanks to the er Jia Feng exact words: "There are many people recommend: in the user variable pythonpath = C:\Anaconda2\Lib\site-packages\theano; Then he was put in a hole. There is absolutely no need, and will cause the Spyder to start when the window, kernel died, and so on, this is my test, engaged a day ... "" When installing anaconda, do not install Python version 3.5, the total display GPU is not available. And do not install Spyder3 series, that is, more than Anaconda4.2.0. Instead, Python chooses 2.7,spyder to select the 2 series, which is the Anaconda4.1.1 version and below. What is the reason? Because Spyder3 always does not call the Ipythonw.exe interpreter, and calls Ipython.exe, causing Theano to compile, always pop the window Nvcc.exe, "

thanks to another answer from ERrednaxelafx : Why do I always output a bunch of DEBUG:NVCC STDOUT mod.cu when I run a Theano program?

First NVCC is Nvidia CUDA Compiler, which is not related to Visual Studio. The second is the debug: The hint message is completely harmless, just the information that is output when you call NVCC to compile something. Upgrade Theano words may not see it always hit out.

Note: The above pop-up windows and debug these two problems I have, but only Aanconda and theano problems, not wrong, irrelevant, I am not lazy to toss. Finally, thank you for all the great gods who silently provide troubleshooting!

Main references:

Teach you how to build a deep learning platform--Avoid pit installation theano+cudawin7 64-bit configuration GPU version Theano and Keras detailed guide (countless times, teach you to avoid the pit)

Install Theano and configure GPU detailed tutorials in the WIN10 environment

The history of Win7+theano+cuda+keras and tears

Converting to the new GPU back end (Gpuarray)

win10-anaconda2-theano-cuda7.5-vs2013

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.