Note to moderator: This is NOT a duplicate post. All of my other posts were deleted, so I'm leaving this one here and will flag the other questions as duplicate.
I could never get a working installation of Theano using Anaconda with Python 3.4, and I also could never get the manual installation working with MinGW, but I was able to get it working flawlessly using WinPython 3.4.
Theano Installation and Configuration on Windows 10 with GPU Acceleration and Python 3.4
If you're using Windows, Theano can be tricky to install and configure. I was able to get it working by following a combination of these tutorials:
Easier configuration of Theano with Python 3.4 using WinPython instead of Anaconda Python
It was much easier to get Theano working on Python 3.4 when using WinPython instead of Anaconda Python, but WinPython stores environment settings in its settings directory (e.g. C:\SciSoft\WinPython-64bit-3.4.4.2\settings\.keras\
) rather than looking in your %USERPROFILE%
for the keras.json file when you're wanting it to pick up your environment settings (as explained in the setup guides). Also, if you are still having trouble, you might just need to set the THEANO_FLAGS
system environment variable to something like this: floatX=float32,device=gpu,nvcc.fastmath=True,lib.cnmem=0.8,blas.ldflags=-LC:\src\OpenBLAS -lopenblas
. (Note that this environment variable overrides the settings in any .theanorc setup file as detailed here in the Theano configuration documentation except if using WinPython, the .theanorc file would go into C:\SciSoft\WinPython-64bit-3.4.4.2\settings\.theanorc
rather than %USERPROFILE\.theanorc
.)
When installing Theano with WinPython, installation is much easier if you use the suggested Theano installation location (C:\SciSoft\
). In that case, your installation directory should look like this:

Fixing bugs in Theano environment batch file when using WinPython
The other issue I ran into with the Theano installation guides is that the batch script had some bugs in it that were causing the dependency paths to be incorrect. Here was my final version of the env.bat
file:
REM configuration of paths
set VSFORPYTHON="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
set SCISOFT=%~dp0
REM add tdm gcc stuff
set PATH=%SCISOFT%TDM-GCC-64\bin;%SCISOFT%TDM-GCC-64\x86_64-w64-mingw32\bin;%PATH%
REM add winpython stuff
CALL %SCISOFT%WinPython-64bit-3.4.4.2\scripts\env.bat
REM configure path for msvc compilers
REM for a 32 bit installation change this line to
REM CALL %VSFORPYTHON%\vcvarsall.bat
CALL %VSFORPYTHON%\vcvarsall.bat amd64
REM return a shell
cmd.exe /k
If using Theano, your .keras file will need to be setup like:
{
"floatx": "float32",
"epsilon": 1e-07,
"image_dim_ordering": "th",
"backend": "theano"
}
Issue with installing CuDNN
Another key thing was that the CuDNN DLLs need to be copied into their corresponding folders in the CUDA installation directory in order for them to be detected. Instructions are detailed here: Instructions for installing CuDNN into CUDA on Windows
If still having issues with Theano installation on Windows with Python 3.4:
Then please review the information here: Full installation guide for Theano on Windows with Python 3.4, including all required environment variables and PATH directories
Another key issue with installing the C++ dependencies for Theano
Another thing I was tripped up by is that in the official Theano documentation, it provides very specific instructions on installing the Microsoft Visual C++ Compiler for Python 2.7. It seems to be that this compiler is also required to be installed in exactly the way that the Theano documentation specifies to perform the installation on the command line to get Python 3.4 to work. I will quote the official Theano documentation, which states:
- open an administrator’s console (got to
start
, then type cmd
,
right-click on the command prompt icon and select run as
administrator
)
cd
to your downloads directory and execute msiexec /i
VCForPython27.msi ALLUSERS=1
General advice about GPU-acceleration
And FYI, if you haven't tried configuring a neural network library, I highly recommend that you use GPU-acceleration.