1. 程式人生 > >WARNING (theano.configdefaults): g++ not detected !

WARNING (theano.configdefaults): g++ not detected !

python環境真是超級難搭!折騰了我好久啊啊啊。。  促使我每次解決完問題非常想寫出來,讓和我遇到同樣情況的小夥伴們有個參考~~  大家可以一起來交流啊。

環境:python3.6.5,64位

匯入:import 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.

百度了好多,我試驗了幾個,都有這樣那樣的附加問題出現,下面我一一寫出

方法一:

忘記是這倆哪個了

裝完之後,嗯。。。報了一大堆錯誤讓我措手不及 

Problem occurred during compilation with the command line below:

D:\pycharm\mingw64\bin\g++.exe -shared -g -march=skylake -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-movdiri -mno-movdir64b --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=skylake -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\include -IC:\Users\zuiai\AppData\Local\Programs\Python\Python36\include -IC:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof -o C:\Users\zuiai\AppData\Local\Theano\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_158_Stepping_9_GenuineIntel-3.6.5-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\zuiai\AppData\Local\Theano\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_158_Stepping_9_GenuineIntel-3.6.5-64\lazylinker_ext\mod.cpp -LC:\Users\zuiai\AppData\Local\Programs\Python\Python36\libs -LC:\Users\zuiai\AppData\Local\Programs\Python\Python36 -lpython36

===============================

In file included from D:/pycharm/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/math.h:36,

                 from C:\Users\zuiai\AppData\Local\Programs\Python\Python36\include/pyport.h:194,

                 from C:\Users\zuiai\AppData\Local\Programs\Python\Python36\include/Python.h:53,

                 from C:\Users\zuiai\AppData\Local\Theano\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_158_Stepping_9_GenuineIntel-3.6.5-64\lazylinker_ext\mod.cpp:1:

D:/pycharm/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cmath:1121:11: error: '::hypot' has not been declared

   using ::hypot;

           ^~~~~

Traceback (most recent call last):

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof\lazylinker_c.py", line 74, in <module>

    raise ImportError()

ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof\lazylinker_c.py", line 91, in <module>

    raise ImportError()

ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "C:/pkl/pkl.py", line 10, in <module>

    import theano

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\__init__.py", line 63, in <module>

    from theano.compile import (

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\compile\__init__.py", line 9, in <module>

    from theano.compile.function_module import *

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\compile\function_module.py", line 22, in <module>

    import theano.compile.mode

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\compile\mode.py", line 12, in <module>

    import theano.gof.vm

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof\vm.py", line 638, in <module>

    from . import lazylinker_c

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof\lazylinker_c.py", line 126, in <module>

    preargs=args)

  File "C:\Users\zuiai\AppData\Local\Programs\Python\Python36\lib\site-packages\theano\gof\cmodule.py", line 2204, in compile_str

    (status, compile_stderr.replace('\n', '. ')))

Exception: Compilation failed (return status=1): In file included from D:/pycharm/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/math.h:36,.                  from C:\Users\zuiai\AppData\Local\Programs\Python\Python36\include/pyport.h:194,.                  from C:\Users\zuiai\AppData\Local\Programs\Python\Python36\include/Python.h:53,.                  from C:\Users\zuiai\AppData\Local\Theano\compiledir_Windows-10-10.0.17134-SP0-Intel64_Family_6_Model_158_Stepping_9_GenuineIntel-3.6.5-64\lazylinker_ext\mod.cpp:1:. D:/pycharm/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/cmath:1121:11: error: '::hypot' has not been declared.    using ::hypot;.            ^~~~~.

Process finished with exit code 1

然後秉著堅持不懈的原則百度加重啟軟體也沒有解決,後來折騰了好久。。也沒改動 真的很玄學  突然就不報錯了。但是我看好多博主都說要mingw和libpython都要裝,那就手動吧,libpython找了好久都沒有找到和python3.6配套的版本。為了後續問題我只能放棄這個方法,轉向下載anaconda了

方法二:

1.先下載anaconda

嗯~ o(* ̄▽ ̄*)o共享完畢,說一點我的私人小問題吧,希望有遇到過的朋友可以幫我解答一下

程式碼:from theano.tensor.signal import downsample

警告⚠: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.   "downsample module has been moved to the theano.tensor.signal.pool module.")

這是個啥啊