在win10 64 bit上安装theano

时间:2022-09-01 10:01:33

在windows10上安装theano,步骤如下:
1、准备工作。先安装Anaconda 64位。然后运行

conda install mingw libpython

2、先安装pycuda,可以去官网上下载最新版本的。

1)解压后,用命令行进入目录。
2)运行 python configure.py
3)然后打开siteconf.py,编辑对应的内容,比如我的:

BOOST_INC_DIR = [r"D:\development\boost_1_60_0"]
BOOST_LIB_DIR = [r"D:\development\boost_1_60_0\lib64-msvc-12.0"]
BOOST_COMPILER = 'msvc-12.0'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-py27']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v7.5'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CURAND_LIBNAME = ['curand']
CXXFLAGS = ["/EHsc"]
LDFLAGS = ['/FORCE']

如果你总是出现 cuda.lib找不到,请看清楚是不是你的写错了。
4)python setup.py build
5) python setup.py install

2、如果没有问题,就可以安装theano了。cd 到对应的目录。

python setup.py install