Installing Theano on Windows - DLL load failed

后端 未结 5 1611
栀梦
栀梦 2021-01-02 22:39

I am trying to install Theano on Windwos 8

Have followed these steps.

I try to test using:

import numpy as np
import time
import theano

prin         


        
相关标签:
5条回答
  • 2021-01-02 22:46

    Quite late, but for future reference. I stumbled upon this thread trying to run an OpenBLAS test script on the CPU. It worked fine on the GPU but the CPU gives me the same errors as the OP. I tried the suggestions here, but that didn't work. Turns out that the line in .theanorc:

    ldflags=-LE:\OpenBLAS-v0.2.14-Win64-int32/bin -lopenblas
    

    shouldn't have the space after bin and before -l. So it should be:

    ldflags=-LE:\OpenBLAS-v0.2.14-Win64-int32/bin-lopenblas
    

    Now everything works. Tried it on:

    Windows 10
    Python 3.5
    Theano 0.9
    Cuda 8 (with CudaMEM and CudaDNN)
    Visual Studio 2015 Community
    
    0 讨论(0)
  • 2021-01-02 23:00

    OK, I finally found the reason at least for my installation using WinPython, python3.5.1.1, Win 7 64bit and mingw64:

    In the .theanorc[.txt] file, I ha, after installing blas, a section [blas] with a line including the openblas include path. I removed that line and left the area below [blas] blank. Restarted WinPython/Spider, opened a new console and it worked.

    Testet afterwards with running mnist.py from Lasagne using Theano.

    0 讨论(0)
  • 2021-01-02 23:03

    This may be a little bit late. I followed the exact same guide as you, and ran into the same error.

    Turns out that it can be fixed by adding the openblas directory to system path. In your example, add "E:\Things_Installed_Here\Theano\openblas" to system path variable.

    Note that depending on where you put the DLL files, you either need to add "E:\Things_Installed_Here\Theano\openblas" or "E:\Things_Installed_Here\Theano\openblas\bin".

    Windows 10 64 bit, Python 3.5.1 (Anaconda 2.5), Theano 0.8.2.

    For those who need it, I am able to install Theano in Windows 10 thanks to these three guides guide1, guide2 and the guide attached by OP.

    0 讨论(0)
  • 2021-01-02 23:05

    Just to add my experience with Win10 64bit and theano (and keras). I was getting the DLL load fail error as well. Tried all the stuff I have found on theano win install webpage and in the different forum and blog posts (mentioned here in Uradium's post).

    It didn't work for me, but here is what worked:

    1. I installed TDM-GCC-64 and openblas, using regedit I have added their /bin directories to PATH (and /lib directory of openblas as well)

    2. made clean venv under miniconda3 - installed prerequisites for theano and keras (scipy, numpy, pyyaml), python 3.5.2

    3. conda install mingw libpython

    4. conda install theano (installs all the mingw libraries as well)

    5. at this point - it worked - so I didnt use any .theanorc.txt file configuration, no fiddling with Windows environment variables. It even worked for keras based python scripts, even-though I had not installed keras into my conda venv it was working in...(I have keras installed in my "normal" non-conda python3, and later I pip installed keras under my conda venv as well).

    0 讨论(0)
  • 2021-01-02 23:07

    I was struggling with getting theano to work on Windows 10 x64 as well, and after reading several help guides, what worked for me in the end was the following:

    1. Install Intel Distribution for Python (make sure c:\intelpython27\ and c:\intelpython27\scripts are in the PATH)
    2. Open a command line and do: conda install mingw libpython
    3. Then do: pip install theano
    4. Download the precompiled libopenblas.dll from http://sourceforge.net/projects/openblas/files/v0.2.14/ (I got OpenBLAS-v0.2.14-Win64-int32.zip)
    5. Download mingw64_dll.zip as well from http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip/download
    6. extract OpenBLAS-v0.2.14-Win64-int32.zip to c:\openblas, for example
    7. extract mingw64_dll.zip to c:\openblas\bin
    8. Add c:\openblas\lib and c:\openblas\bin to PATH
    9. Create .theanorc.txt in c:\Users\{username}
    10. Put the following in .theanorc.txt:

      [global]
      floatX = float32
      device = cpu
      
      [blas]
      ldflags = -LC:\\openblas\\bin -LC:\\openblas\\lib -lopenblas
      

    Hope this helps someone.

    0 讨论(0)
提交回复
热议问题