• 布置theano(Windows10,无cuda)


    软件包准备

    1、Anaconda 下载地址,包含python、numpy、scipy、nose、pip等包,嗯,很爽。

    2、tdm64-gcc 下载地址,windows下的gcc、g++编译器,用来theano性能优化的,不然速度会很慢(官方文档如是说)

    3、theano源码 下载地址,github上的实时更新的thenao源码,可以下载zip包,或者clone。

    一、安装

    Anaconda、tdm64-gcc一路下一步安装即可,没有什么特殊需要注意的。

    下载theano源码后进入其根目录例如:theano-master,cmd执行如下命令进行安装:

    python setup.py develop

    二、配置theanorc.txt

    编辑thenaorc.txt 存放在用户的根目录,知道根目录在哪可以cmd执行如下命令进行查看:

    echo  %USERPROFILE%

    theanorc.txt内容如下(只配置了gcc、g++路径,用来theano的优化):

    [cxx]
    flags=C:TDM-GCC-64in
    以上C:TDM-GCC-64in路径为tdm-gcc编译器的bin目录,按照你自己的路径来配置。

    三、测试theano安装成功

    cmd打开python,执行:

    import theano
    theano.test()

    import theano执行失败证明theano安装不成功,我在theano.test()时出现如下错误

    ERROR: Failure: ImportError (No module named nose_parameterized)

    安装nose_parameterized即可,cmd执行:

    pip install nose_parameterized

    后记

    1、LINK : fatal error LNK1181: cannot open input file 'cublas.lib' 的问题

    可能是因为cuda安装的该版本(我的是7.5),这个版本的cublas.lib只有64位的,这样如果你的anacanda安装的是32位就会在编译的时候报错,链接不了。

    2、theano 提示 g++ not detected !

    导入theano包后出现如下警告:

    WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

    解决办法:

    conda install mingw libpython

    3、安装cudnn

    cudnn下载地址

    解压缩,复制到cuda的相应的文件夹里即可。

    4、配置文件

    [global]
    device = cpu
    floatX = float32
    exception_verbosity=high
    
    [lib]
    cnmem = .95
    
    [cuda]  
    root=C:Program FilesNVIDIA GPU Computing ToolkitCUDAv7.0in  
    
    
    [nvcc]
    flags=-LD:Anaconda2libs
    compiler_bindir=C:Program Files (x86)Microsoft Visual Studio 10.0VCin
    fastmath = True
    
    [traceback]
    limit=20
  • 相关阅读:
    每天学习Linux之-系统启动过程
    差模和共模干扰
    每天学习Linux之-目录结构
    欧姆龙CP1H 原点搜索和原点返回功能
    NPN,PNP接线总结
    MyBatis插件开发
    MyBatis运行原理
    MyBatis逆向工程
    MyBatis-Spring整合
    MyBatis缓存机制
  • 原文地址:https://www.cnblogs.com/zhuangliu/p/5403458.html
Copyright © 2020-2023  润新知