Theano导入错误Windows 7-64b

Theano导入错误Windows 7-64b,windows,import,theano,Windows,Import,Theano,我刚刚安装了Theano。 我在python中导入theano时遇到问题。当我在Python27 32位、Windows7 64位中导入Theano时,我得到了以下错误和警告:我还应该补充一点,目前我已经安装了GCC4.8.1。我必须做些什么来修复它 谢谢你,阿福申 =============================== 00001 #include <Python.h> 00002 #include "structmember.h" 00003 #include

我刚刚安装了Theano。 我在python中导入theano时遇到问题。当我在Python27 32位、Windows7 64位中导入Theano时,我得到了以下错误和警告:我还应该补充一点,目前我已经安装了GCC4.8.1。我必须做些什么来修复它

谢谢你,阿福申

===============================
00001   #include <Python.h>
00002   #include "structmember.h"
00003   #include <sys/time.h>
00004   
00005   // Old Python compatibility from here:
00006   // http://www.python.org/dev/peps/pep-0353/
00007   #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
00008   typedef int Py_ssize_t;
00009   #define PY_SSIZE_T_MAX INT_MAX
00010   #define PY_SSIZE_T_MIN INT_MIN
00011   // This one was taken from:
00012   // http://svn.python.org/projects/python/trunk/Modules/_ctypes/ctypes.h
00013   #define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob)
00014   #endif
00015   
00016   #if PY_VERSION_HEX >= 0x03000000
00017   #include "numpy/npy_3kcompat.h"
00018   #define PyCObject_AsVoidPtr  NpyCapsule_AsVoidPtr
00019   #define PyCObject_GetDesc  NpyCapsule_GetDesc
00020   #define PyCObject_Check NpyCapsule_Check
00021   #endif
00022   
00023   #ifndef Py_TYPE
00024   #define Py_TYPE(obj) obj->ob_type
00025   #endif
00026   
00027   /**
00028   
00029   TODO: 
00030   - Check max supported depth of recursion
00031   - CLazyLinker should add context information to errors caught during evaluation. Say what node we were on, add the traceback attached to the node.
00032   - Clear containers of fully-useed intermediate results if allow_gc is 1
00033   - Add timers for profiling
00034   - Add support for profiling space used.
00035   
00036   
00037     */
00038   static double pytime(const struct timeval * tv)
00039   {
00040     struct timeval t;
00041     if (!tv)
00042       {
00043         tv = &t;
00044         gettimeofday(&t, NULL);
00045       }
00046     return (double) tv->tv_sec + (double) tv->tv_usec / 1000000.0;
00047   }
00048   
00049   /**
00050     Helper routine to convert a PyList of integers to a c array of integers.
00051     */
00052   static int unpack_list_of_ssize_t(PyObject * pylist, Py_ssize_t **dst, Py_ssize_t *len,
00053                                     const char* kwname)
00054   {
00055     Py_ssize_t buflen, *buf;
00056     if (!PyList_Check(pylist))
00057       {
00058         PyErr_Format(PyExc_TypeError, "%s must be list", kwname);
00059         return -1;
00060       }
00061     assert (NULL == *dst);
00062     *len = buflen = PyList_Size(pylist);
00063     *dst = buf = (Py_ssize_t*)calloc(buflen, sizeof(Py_ssize_t));
00064     assert(buf);
00065     for (int ii = 0; ii < buflen; ++ii)
00066       {
00067         PyObject * el_i = PyList_GetItem(pylist, ii);
00068         Py_ssize_t n_i = PyNumber_AsSsize_t(el_i, PyExc_IndexError);
00069         if (PyErr_Occurred())
00070           {
00071             free(buf);
00072             *dst = NULL;
00073             return -1;
00074           }
00075         buf[ii] = n_i;
00076       }
00077     return 0;
00078   }
00079   
00080   /**
00081   
00082     CLazyLinker
00083   
00084   
00085     */
00086   typedef struct {
00087       PyObject_HEAD
00088       /* Type-specific fields go here. */
00089       PyObject * nodes; // the python list of nodes
00090       PyObject * thunks; // python list of thunks
00091       PyObject * pre_call_clear; //list of cells to clear on call.
00092       int allow_gc;
00093       Py_ssize_t n_applies;
00094       int n_vars;    // number of variables in the graph
00095       int * var_computed; // 1 or 0 for every variable
00096       PyObject ** var_computed_cells;
00097       PyObject ** var_value_cells;
00098       Py_ssize_t **dependencies; // list of vars dependencies for GC
00099       Py_ssize_t *n_dependencies;
00100   
00101       Py_ssize_t n_output_vars;
00102       Py_ssize_t * output_vars; // variables that *must* be evaluated by call
00103   
00104       int * is_lazy; // 1 or 0 for every thunk
00105   
00106       Py_ssize_t * var_owner; // nodes[[var_owner[var_idx]]] is var[var_idx]->owner
00107       int * var_has_owner; //  1 or 0
00108   
00109       Py_ssize_t * node_n_inputs;
00110       Py_ssize_t * node_n_outputs;
00111       Py_ssize_t ** node_inputs;
00112       Py_ssize_t ** node_outputs;
00113       Py_ssize_t * node_inputs_outputs_base; // node_inputs and node_outputs point into this
00114       Py_ssize_t * node_n_prereqs;
00115       Py_ssize_t ** node_prereqs;
00116   
00117       Py_ssize_t * update_storage; // input cells to update with the last outputs in output_vars
00118       Py_ssize_t n_updates;
00119   
00120       void ** thunk_cptr_fn;
00121       void ** thunk_cptr_data;
00122       PyObject * call_times;
00123       PyObject * call_counts;
00124       int do_timing;
00125       int need_update_inputs;
00126       int position_of_error; // -1 for no error, otw the index into `thunks` that failed.
00127   } CLazyLinker;
00128   
00129   
00130   static void
00131   CLazyLinker_dealloc(PyObject* _self)
00132   {
00133     CLazyLinker* self = (CLazyLinker *) _self;
00134     free(self->thunk_cptr_fn);
00135     free(self->thunk_cptr_data);
00136   
00137     free(self->is_lazy);
00138   
00139     free(self->update_storage);
00140   
00141     if (self->node_n_prereqs)
00142       {
00143         for (int i = 0; i < self->n_applies; ++i)
00144           {
00145             free(self->node_prereqs[i]);
00146           }
00147       }
00148     free(self->node_n_prereqs);
00149     free(self->node_prereqs);
00150     free(self->node_inputs_outputs_base);
00151     free(self->node_n_inputs);
00152     free(self->node_n_outputs);
00153     free(self->node_inputs);
00154     free(self->node_outputs);
00155   
00156     if (self->dependencies)
00157       {
00158         for (int i = 0; i < self->n_vars; ++i)
00159           {
00160             free(self->dependencies[i]);
00161           }
00162         free(self->dependencies);
00163         free(self->n_dependencies);
00164       }
00165   
00166     free(self->var_owner);
00167     free(self->var_has_owner);
00168     free(self->var_computed);
00169     if (self->var_computed_cells)
00170       {
00171         for (int i = 0; i < self->n_vars; ++i)
00172           {
00173             Py_DECREF(self->var_computed_cells[i]);
00174             Py_DECREF(self->var_value_cells[i]);
00175           }
00176       }
00177     free(self->var_computed_cells);
00178     free(self->var_value_cells);
00179     free(self->output_vars);
00180   
00181     Py_XDECREF(self->nodes);
00182     Py_XDECREF(self->thunks);
00183     Py_XDECREF(self->call_times);
00184     Py_XDECREF(self->call_counts);
00185     Py_XDECREF(self->pre_call_clear);
00186     Py_TYPE(self)->tp_free((PyObject*)self);
00187   }
00188   static PyObject *
00189   CLazyLinker_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
00190   {
00191       CLazyLinker *self;
00192   
00193       self = (CLazyLinker *)type->tp_alloc(type, 0);
00194       if (self != NULL) {
00195         self->nodes = NULL;
00196         self->thunks = NULL;
00197         self->pre_call_clear = NULL;
00198   
00199         self->allow_gc = 1;
00200         self->n_applies = 0;
00201         self->n_vars = 0;
00202         self->var_computed = NULL;
00203         self->var_computed_cells = NULL;
00204         self->var_value_cells = NULL;
00205         self->dependencies = NULL;
00206         self->n_dependencies = NULL;
00207   
00208         self->n_output_vars = 0;
00209         self->output_vars = NULL;
00210   
00211         self->is_lazy = NULL;
00212   
===============================
00001#包括
00002#包括“structmember.h”
00003#包括
00004
00005//旧Python兼容性从这里开始:
00006   // http://www.python.org/dev/peps/pep-0353/
00007#如果PY#U版本#U十六进制<0x02050000&&!已定义(PY_-SSIZE_-T_-MIN)
00008 typedef int Py_ssize_t;
00009#定义PY_SSIZE_T_MAX INT_MAX
00010#定义PY_-SSIZE_-T_-MIN INT_-MIN
00011//这张照片取自:
00012   // http://svn.python.org/projects/python/trunk/Modules/_ctypes/ctypes.h
00013#定义PyNumber_ASSIZE_t(ob,exc)PyInt_AsLong(ob)
00014#endif
00015
00016#如果PY_版本_十六进制>=0x03000000
00017#包括“numpy/npy#3kcompat.h”
00018#将PyCObject_定义为voidptr NpyCapsule_定义为voidptr
00019#定义PyCObject_GetDesc NpyCapsule_GetDesc
00020#定义PyCObject_检查NpyCapsule_检查
00021#完
00022
00023#ifndef Py#U型
00024#定义Y#U类型(obj)obj->ob#U类型
00025#完
00026
00027   /**
00028
00029待办事项:
00030-检查支持的最大递归深度
00031-CLazyLinker应将上下文信息添加到评估期间捕获的错误中。说出我们在哪个节点上,添加附加到该节点的回溯。
00032-如果allow_gc为1,则清除充分使用的中间结果容器
00033-添加用于分析的计时器
00034-添加对所用分析空间的支持。
00035
00036
00037     */
00038静态双pytime(const struct timeval*tv)
00039   {
00040结构时间值t;
00041如果(!电视)
00042       {
00043电视=&t;
00044 gettimeofday(&t,NULL);
00045       }
00046返回(双)tv->tv_sec+(双)tv->tv_usec/1000000.0;
00047   }
00048
00049   /**
00050帮助程序,用于将整数的PyList转换为整数的c数组。
00051     */
00052静态整型解包列表(PyObject*pylist,PyUsize*t**dst,PyUsize*len,
00053常量字符*kwname)
00054   {
00055 Py_ssize_t buflen,*buf;
00056如果(!PyList_检查(PyList))
00057       {
00058 PyErr_格式(PyExc_TypeError,“%s必须是列表”,kwname);
00059返回-1;
00060       }
00061断言(NULL==*dst);
00062*len=buflen=PyList_尺寸(PyList);
00063*dst=buf=(Py_-ssize_-t*)calloc(buflen,sizeof(Py_-ssize_-t));
00064断言(buf);
00065(int ii=0;iiowner
00107 int*var_拥有所有者;//1或0
00108
00109 Py_ssize_t*节点输入;
00110 Py_-ssize_-t*节点输出;
00111 Py_ssize_t**节点输入;
00112 Py_ssize_t**节点输出;
00113 Py_-ssize_t*节点_输入_输出_基;//节点_输入和节点_输出指向此
00114 Py_-ssize_-t*节点预需求;
00115副本**节点预需求;
00116
00117 Py_ssize_t*update_storage;//要使用输出变量中的最后输出更新的输入单元格
00118 Py_-ssize_-t n_更新;
00119
00120无效**thunk_cptr_fn;
00121无效**thunk_cptr_数据;
00122 PyObject*调用次数;
00123 PyObject*调用计数;
00124 int do_定时;
00125 int需要更新输入;
00126 int position of_error;/-1如果没有错误,将索引otw到失败的'thunks'。
00127}CLazyLinker;
00128
00129
00130静态空隙
00131 CLazyLinker_dealloc(PyObject*_self)
00132   {
00133 CLazyLinker*self=(CLazyLinker*)\u self;
00134自由(自->thunk_cptr_fn);
00135免费(自->thunk_cptr_数据);
00136
00137自由(自我->懒惰);
00138
00139免费(自我->更新存储);
00140
00141如果(自我->节点需求)
00142       {
00143用于(int i=0;in_适用;++i)
00144           {
00145自由(自->节点预需求[i]);
00146           }
00147       }
00148自由(自我->节点需求);
00149自由(自->节点预需求);
00150自由(自->节点输入输出基础);
00151自由(自->节点输入);
00152自由(自->节点输出);
00153自由(自->节点输入);
00154自由(自->节点输出);
00155
00156如果(自->依赖)
00157       {
00158用于(int i=0;in_vars;++i)
00159           {
00160自由(自->依赖[i]);
00161
01075       PyModule_AddObject(m, "CLazyLinker", (PyObject *)&lazylinker_ext_CLazyLinkerType);
01076   
01077       return RETVAL;
01078   }
01079   
01080   
Problem occurred during compilation with the command line below:
C:\cygwin64\bin\g++.exe -shared -g -march=nehalem -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=nehalem -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m32 -IC:\python2732\lib\site-packages\numpy-1.9.0-py2.7-win32.egg\numpy\core\include -IC:\python2732\include -o C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\lazylinker_ext.pyd C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp -LC:\python2732\libs -LC:\python2732 -lpython27
===============================
In file included from C:\python2732\include/Python.h:86:0,
                 from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:
C:\python2732\include/intobject.h:46:35: error: expected initializer before 'PyInt_AsUnsignedLongLongMask'
 PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
                                   ^
In file included from C:\python2732\include/Python.h:8:0,
                 from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:
C:\python2732\include/pyconfig.h:302:23: error: '__int64' was not declared in this scope
 # define PY_LONG_LONG __int64
                       ^
C:\python2732\include/longobject.h:50:44: note: in expansion of macro 'PY_LONG_LONG'
 PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
                                            ^
In file included from C:\python2732\include/Python.h:58:0,
                 from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:
C:\python2732\include/pyconfig.h:302:23: error: '__int64' does not name a type
 # define PY_LONG_LONG __int64
                       ^
C:\python2732\include/pyport.h:793:34: note: in definition of macro 'PyAPI_FUNC'
 #       define PyAPI_FUNC(RTYPE) RTYPE
                                  ^
C:\python2732\include/longobject.h:52:12: note: in expansion of macro 'PY_LONG_LONG'
 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
            ^
In file included from C:\python2732\include/Python.h:88:0,
                 from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:
C:\python2732\include/longobject.h:53:35: error: expected initializer before 'PyLong_AsUnsignedLongLong'
 PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
                                   ^
C:\python2732\include/longobject.h:54:35: error: expected initializer before 'PyLong_AsUnsignedLongLongMask'
 PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
                                   ^
In file included from C:\python2732\include/Python.h:58:0,
                 from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:
C:\python2732\include/pyconfig.h:302:23: error: '__int64' does not name a type
 # define PY_LONG_LONG __int64
                       ^
C:\python2732\include/pyport.h:793:34: note: in definition of macro 'PyAPI_FUNC'
 #       define PyAPI_FUNC(RTYPE) RTYPE
                                  ^
C:\python2732\include/longobject.h:55:12: note: in expansion of macro 'PY_LONG_LONG'
 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
            ^

Traceback (most recent call last):
  File "C:\Users\Dell\Documents\Pyton\Home Work 1\test-theano\test-theano.py", line 7, in <module>
    from theano import *
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\__init__.py", line 55, in <module>
    from theano.compile import \
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\compile\__init__.py", line 9, in <module>
    from theano.compile.function_module import *
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\compile\function_module.py", line 18, in <module>
    import theano.compile.mode
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\gof\vm.py", line 568, in <module>
    import lazylinker_c
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\gof\lazylinker_c.py", line 116, in <module>
    preargs=args)
  File "C:\python2732\lib\site-packages\theano-0.7.0-py2.7.egg\theano\gof\cmodule.py", line 2010, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): In file included from C:\python2732\include/Python.h:86:0,.                  from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:. C:\python2732\include/intobject.h:46:35: error: expected initializer before 'PyInt_AsUnsignedLongLongMask'.  PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);.                                    ^. In file included from C:\python2732\include/Python.h:8:0,.                  from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:. C:\python2732\include/pyconfig.h:302:23: error: '__int64' was not declared in this scope.  # define PY_LONG_LONG __int64.                        ^. C:\python2732\include/longobject.h:50:44: note: in expansion of macro 'PY_LONG_LONG'.  PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);.                                             ^. In file included from C:\python2732\include/Python.h:58:0,.                  from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:. C:\python2732\include/pyconfig.h:302:23: error: '__int64' does not name a type.  # define PY_LONG_LONG __int64.                        ^. C:\python2732\include/pyport.h:793:34: note: in definition of macro 'PyAPI_FUNC'.  #       define PyAPI_FUNC(RTYPE) RTYPE.                                   ^. C:\python2732\include/longobject.h:52:12: note: in expansion of macro 'PY_LONG_LONG'.  PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);.             ^. In file included from C:\python2732\include/Python.h:88:0,.                  from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:. C:\python2732\include/longobject.h:53:35: error: expected initializer before 'PyLong_AsUnsignedLongLong'.  PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);.                                    ^. C:\python2732\include/longobject.h:54:35: error: expected initializer before 'PyLong_AsUnsignedLongLongMask'.  PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);.                                    ^. In file included from C:\python2732\include/Python.h:58:0,.                  from C:\Users\Dell\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_30_Stepping_5_GenuineIntel-2.7.8-32\lazylinker_ext\mod.cpp:1:. C:\python2732\include/pyconfig.h:302:23: error: '__int64' does not name a type.  # define PY_LONG_LONG __int64.                        ^. C:\python2732\include/pyport.h:793:34: note: in definition of macro 'PyAPI_FUNC'.  #       define PyAPI_FUNC(RTYPE) RTYPE.                                   ^. C:\python2732\include/longobject.h:55:12: note: in expansion of macro 'PY_LONG_LONG'.  PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);.             ^.