win10 安装theano

来源:互联网 发布:网络的意义与使用界限 编辑:程序博客网 时间:2024/04/28 21:45

参考文档:1. http://blog.csdn.net/churximi/article/details/51627849

      • 安装anaconda
      • 安装cuda
      • 配置
      • 测试

安装anaconda

  1. 国内到https://mirror.tuna.tsinghua.edu.cn/下载
  2. 更换成国内源,国内源速度快,但不一定稳定

    conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'      conda config --set show_channel_urls yes
  3. conda install mingw libpython,theano需要安装mingw和libpython

  4. pip install theano 安装theano

安装cuda

这里安装的cuda8.0,**似乎**5.5版本以上的都可以,只是要有相应的vc版本。具体cuda和vc版本的对应看cuda的安装文档。
根据Nvidia官方Windows cuda8.0安装文档安装。

配置

C:\Users\JohnsonLai添加.theanorc.txt,然后编辑

  • CPU版本
[blas]ldflags =[gcc]cxxflags = -IC:\Users\JohnsonLai\Anaconda2\MinGW\x86_64-w64-mingw32\include
  • GPU版本
[global]device = gpufloatX = float32openmp=False[blas]ldflags =[gcc]cxxflags = -IC:\Users\JohnsonLai\Anaconda2\MinGW\x86_64-w64-mingw32\include[nvcc]flags = -LC:\Users\JohnsonLai\Anaconda2\libscompiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

测试

import theano.tensor

gpu版本可能会提示一些warning,可能是libgpuarray的,本文还未进行修改。如果没有报error,就对了。

0 0