Reputation: 2793
In duration of following these tutorial Neural net , on running test.py file , I am getting these exceptions and warnings .I had already tried previous suggestions but nothing has worked .
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
C:\ProgramData\Anaconda3\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
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.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Any proper fix will be appreciated.
After trying with conda install m2w64-toolchain
. Another error comes which says,
*You can find the C code in this temporary file: C:\Users\CERTAI~1\AppData\Local\Temp\theano_compilation_error_7bgw9_s9
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\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:\shubhamprojectwork\all Work 2018\kaggle\DeepLearningPython35-master\DeepLearningPython35-master\test.py", line 156, in <module>
import network3
File "C:\shubhamprojectwork\all Work 2018\kaggle\DeepLearningPython35-master\DeepLearningPython35-master\network3.py", line 37, in <module>
import theano
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\__init__.py", line 110, in <module>
from theano.compile import (
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
from theano.compile.mode import *
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
import theano.gof.vm
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\gof\vm.py", line 673, in <module>
from . import lazylinker_c
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
preargs=args)
File "C:\ProgramData\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `_import_array':
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1470: undefined reference to `__imp_PyExc_ImportError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1476: undefined reference to `__imp_PyExc_AttributeError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1481: undefined reference to `__imp_PyCapsule_Type'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1482: undefined reference to `__imp_PyExc_RuntimeError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1497: undefined reference to `__imp_PyExc_RuntimeError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1505: undefined reference to `__imp_PyExc_RuntimeError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1511: undefined reference to `__imp_PyExc_RuntimeError'
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1521: undefined reference to `__imp_PyExc_RuntimeError'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o:C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1533: more undefined references to `__imp_PyExc_RuntimeError' follow
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `NpyCapsule_Check':
. C:/ProgramData/Anaconda3/lib/site-packages/numpy/core/include/numpy/npy_3kcompat.h:456: undefined reference to `__imp_PyCapsule_Type'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `unpack_list_of_ssize_t':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:48: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:58: undefined reference to `__imp_PyExc_IndexError'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `CLazyLinker_init':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:352: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:370: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:385: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:389: undefined reference to `__imp_PyExc_IndexError'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o:C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:393: more undefined references to `__imp_PyExc_IndexError' follow
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `CLazyLinker_init':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:405: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:420: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:426: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:440: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:444: undefined reference to `__imp__Py_NoneStruct'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `c_call':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:545: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:545: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:545: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:546: undefined reference to `__imp__Py_NoneStruct'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o:C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:546: more undefined references to `__imp__Py_NoneStruct' follow
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `lazy_rec_eval':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:618: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:641: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:649: undefined reference to `__imp_PyExc_ValueError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:657: undefined reference to `__imp_PyExc_IndexError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:708: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:715: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:721: undefined reference to `__imp_PyExc_TypeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:771: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:771: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:772: undefined reference to `__imp__Py_NoneStruct'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `CLazyLinker_call':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:814: undefined reference to `__imp_PyExc_RuntimeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:826: undefined reference to `__imp_PyExc_RuntimeError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:839: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:839: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:840: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:849: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:849: undefined reference to `__imp__Py_NoneStruct'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o:C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:850: more undefined references to `__imp__Py_NoneStruct' follow
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `CLazyLinker_call':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:894: undefined reference to `__imp_PyExc_AssertionError'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:937: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:937: undefined reference to `__imp__Py_NoneStruct'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:938: undefined reference to `__imp__Py_NoneStruct'
. C:\Users\CERTAI~1\AppData\Local\Temp\ccFdFXU1.o: In function `CLazyLinker_set_allow_gc':
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:973: undefined reference to `__imp_PyBool_Type'
. C:/Users/Certainty1/AppData/Local/Theano/compiledir_Windows-10-10.0.16299-SP0-Intel64_Family_6_Model_142_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:976: undefined reference to `__imp__Py_TrueStruct'
. collect2.exe: error: ld returned 1 exit status
.*
Upvotes: 6
Views: 32650
Reputation: 304
For those, who did everything, which is said on this page, but is still experiencing the following messages (which mean you will have significantly reduced performance):
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
C:\Users\user\miniconda3\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
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.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
I could find the place where this message is coming from: it is in the path of your python environment installation <path_to_your_python_env>/Lib/site-packages/theano/misc/windows.py
. Here in the method subprocess_Popen
you will find the string
params['shell'] = True
Which you need to delete or comment out. The checks for the existence of g++ and c++ compilers run with calling this method. And using shell=True
parameter causes on the Windows machine a not found error (which is silenced, so you would never know [honestly, I do not know who decided to do it like this]). The error is most probably because the system call command passed to the subprocess.Popen
gets corrupted with some symbol: it is recommended to use string args
parameter when using shell=True
, which authors of Theano do not adhere to (they pass lists).
If shell is True, it is recommended to pass args as a string rather than as a sequence.
Once I have commented out this string and tried to import Theano/PyMC3, the messages were gone and I could enjoy the top performance of those amazing tools.
Upvotes: 2
Reputation: 1262
i ran into this same issue yesterday.
I had do download and install g++ as theano requires this to work
Please follow this link on how to download and install
http://www.instructables.com/id/How-to-Install-MinGW-GCCG-Compiler-in-Windows-XP78/
After adding the path to my environment, i uninstalled and reinstalled anaconda.
I created a new environment for python 3.5 Activated it then i followed the instructions here for installing theano
http://deeplearning.net/software/theano/install_windows.html
Their steps downgraded my python to 2.7
Then i did the following
1: pip install future 2: pip install pillow 3: conda install nb_conda_kernels 4: pip install future --upgrade 5: Added the environment variable - MKL_THREADING_LAYER=GNU 6: Restarted my terminal and everything works.
I didn't need to go through these initial step for subsequent environments After activating a python 3.5 environment, doing
conda install theano set everything i needed up for me
Hope it helps
Upvotes: 0
Reputation: 21
I had the same error. On my PC I had python 3.6. I did this:
1. I uninstalled and reinstalled conda.
2. I created a environment using conda with python 3.5
3. installed m2w64-toolchain in the environment
And it worked!
Upvotes: 2
Reputation: 431
According to my personal experience, the successive error is caused by non- existence (or simply not found) of python*.dll for windows. You can solve this problem by 'conda install libpython'
Upvotes: 12