Configure Theano in Windows 8.1 x64

Configure Theano in Windows 8.1

1. Install CUDA Toolkit

  CUDA 6.5: https://developer.nvidia.com/cuda-toolkit-65

  Choose Windows 8.1 Desktop 64-bit EXE

2. Install Python and Theano related packages:

  Install Anaconda: https://www.continuum.io/downloads#_windows

  Choose Python 2.7 64-bit version.

3. Anaconda may not include MinGW package, install manually using Conda if nessesary:

  Script: conda install -c https://conda.anaconda.org/anaconda mingw

4. Install Theano using PIP

  Script: pip install theano

5. Check using test script:

import theano.tensor as T
from theano import function
x = T.dscalar('x')
y = T.dscalar('y')
z = x + y
f = function([x,y],z)
print f(2,3)

  If error like 'undefined reference to `__imp__Py_TrueStruct' occured, consider: https://github.com/Theano/Theano/issues/2867

  Execute:

    gendef python27.dll

    dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpython27.a --input-def python27.def

  Copy libpython27.a to Anaconda\libs

 Extra: configurarion file for Theano:

  create .theanorc.txt file under C:\Users\UserName\

[blas]
ldflags =

[global] 
floatX = float32
device = gpu

# By default the compiled files were being written to my local network drive.
# Since I have limited space on this drive (on a school's network),
# we can change the path to compile the files on the local machine.
# You will have to create the directories and modify according to where you 
# want to install the files. 
# Uncomment if you want to change the default path to your own.
# base_compiledir = /local-scratch/jer/theano/

[nvcc]
fastmath = True
flags = -LE:\Anaconda\libs
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

[gcc]
cxxflags = -IE:\Anaconda\MinGW

[cuda]
# Set to where the cuda drivers are installed.
# You might have to change this depending where your cuda driver/what version is installed.

 

Just in case you want to install Keras:

Update Theano: pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

 

转载于:https://www.cnblogs.com/StandFast/p/5024036.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值