pip安装后的Theano错误

时间:2018-04-08 18:17:51

标签: gcc install anaconda theano

我一直在尝试将Theano作为我32位Windows 10上Keras的后端。我已经安装了许多不同的东西,例如CUDA和Python 3.5(我的默认值为3.6.5)甚至安装了与Anaconda。当我在我的终端中使用pip freeze时,Anaconda下载不存在,而我的代码在conda安装后没有识别出来,所以我只是简单地安装了Theano,当我运行它时总会给我这个错误。我通常使用Atom,而不是Anaconda,所以我不确定conda安装是否对Atom不起作用。我也不确定如何将Atom中的代码切换到Python 3.5,因为我知道Theano只能达到3.5,或者甚至是必要的。我之前通过MinGW安装了我的g ++ gcc编译器,我怀疑可能是这个错误的罪魁祸首,因为StackOverflow问题上的类似错误与此有关。错误如下所示。这是一个噩梦般的安装过程,所以我为所有关于我一直在做的事情的信息道歉。非常感谢帮助。

另外,当我使用python 3.5在我的终端中导入Keras时,它说没有这样的模块。

有些事情是非常错误的。

错误:

Using Theano backend.

You can find the C code in this temporary file: C:\Users\AARONM~1\AppData\Local\Temp\theano_compilation_error_9whx6ow7
Traceback (most recent call last):
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\gof\lazylinker_c.py", line 75, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\gof\lazylinker_c.py", line 92, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Aaron Mazie\Desktop\tradingbots\testntrain6.py", line 11, in <module>
    from keras.layers.core import Dense, Activation, Dropout
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\keras\utils\__init__.py", line 6, in <module>
    from . import conv_utils
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\keras\backend\__init__.py", line 81, in <module>
    from .theano_backend import *
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\keras\backend\theano_backend.py", line 7, in <module>
    import theano
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\__init__.py", line 110, in <module>
    from theano.compile import (
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\gof\vm.py", line 673, in <module>
    from . import lazylinker_c
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0,
.                  from C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\include/pyport.h:194,
.                  from C:\Users\Aaron Mazie\AppData\Local\Programs\Python\Python36-32\include/Python.h:53,
.                  from C:\Users\Aaron Mazie\AppData\Local\Theano\compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.5-32\lazylinker_ext\mod.cpp:1:
. c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
.    using ::hypot;
.            ^~~~~
. 

1 个答案:

答案 0 :(得分:0)

对于任何想知道的人,我手动卸载了所有内容,包括Theano缓存文件,并观看了此视频:https://www.youtube.com/watch?v=J70j6q7aOi4&t=131s&index=1&list=LLwpbw2KREgJdXEC0gLRTy4g