【问题标题】:Theano Windows 7 import errorTheano Windows 7 导入错误
【发布时间】:2017-05-14 05:45:14
【问题描述】:

今天我尝试在 W7 x64 上安装 Theano。我想我安装了它,但我在某个地方也犯了一个错误,我不知道在哪里。我实际上想将它与 CUDA 一起使用。

这是我安装的程序: Anaconda 4.2.0 x64 (Python 2.7.12), TDM 海湾合作委员会, CUDA 8.0 视觉工作室 13 Theano 通过 Git

这是 theanorc 文件:

[global]
floatX = float32
device = gpu

[nvcc]
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0

就像我说的,我不知道我在哪里犯了错误。这是我写“import theano”时的输出

提前谢谢各位!

In [2]: import theano
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-3397704bd624> in <module>()
----> 1 import theano

C:\Users\silverstone\Theano\theano\__init__.py in <module>()
     64     object2, utils)
     65
---> 66 from theano.compile import (
     67     SymbolicInput, In,
     68     SymbolicOutput, Out,

C:\Users\silverstone\Theano\theano\compile\__init__.py in <module>()
      8         SpecifyShape, specify_shape, register_specify_shape_c_code)
      9
---> 10 from theano.compile.function_module import *
     11
     12 from theano.compile.mode import *

C:\Users\silverstone\Theano\theano\compile\function_module.py in <module>()
     16
     17 import theano
---> 18 from theano import config, gof
     19 from theano.compat import izip
     20 from theano.gof import graph

ImportError: cannot import name gof

ps:还有一个错误 -> http://pastebin.com/V59Pm9Qa

【问题讨论】:

标签: python-2.7 theano theano-cuda


【解决方案1】:

您是否添加了系统变量?如果没有,试试这个:

右键计算机->属性->高级系统设置->环境变量

添加一个新的系统变量

名称 = THEANO_FLAGS

值 = floatX=float32,device=gpu,nvcc.fastmath=True

还将 Visual Studio 的 c++ 编译器添加到路径中

添加 ;pathToYourVSInstallation\VC\bin\

如果这不起作用,请从顶部到那里再做一次: https://stackoverflow.com/a/41401271/7349628

【讨论】:

    猜你喜欢
    • 2015-11-08
    • 2016-11-26
    • 1970-01-01
    • 1970-01-01
    • 2018-08-15
    • 1970-01-01
    • 2016-07-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多