我使用蟒蛇與Python在Windows 8導入錯誤scikit-neuralnetwork
在嘗試使用軟件包scikit-neuralnetwork 3.4 64位,這行代碼會引發以下異常:
from sknn.mlp import Classifier, Layer
我裝的GCC和g ++(4.8.1)編譯器和正確的方式加入它們PATH,然而以下錯誤繼續出現:
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:
g++ -shared -g -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Users\Mi\Anaconda3\lib\site-packages\numpy\core\include - IC:\Users\Mi\Anaconda3\include -o C:\Users\Mi\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-3.4.3-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\Mi\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-3.4.3-64\lazylinker_ext\mod.cpp -LC:\Users\Mi\Anaconda3\libs -LC:\Users\Mi\Anaconda3 -lpython34
Traceback (most recent call last):
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 65, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 82, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mi\Desktop\temp22.py", line 10, in <module>
from sknn.mlp import Classifier, Layer
File "C:\Users\Mi\Anaconda3\lib\site-packages\sknn\mlp.py", line 17, in <module>
import theano
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\__init__.py", line 55, in <module>
from theano.compile import \
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 9, in <module>
from theano.compile.function_module import *
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 18, in <module>
import theano.compile.mode
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
import theano.gof.vm
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\vm.py", line 568, in <module>
from . import lazylinker_c
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 117, in <module>
preargs=args)
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 1989, in compile_str
compile_stderr = decode(p_out[1])
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compat\__init__.py", line 35, in decode
return x.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 10: invalid continuation byte
一個很好的建議:我在Windows中遇到了這樣的錯誤信息,我經常說,theano不是用於Windows,而是用於Linux或Mac。因此,我改變了Linux,並說它工作。我花了很多時間尋找解決方案,我很高興來到這裏。 :) – Geeocode
問題通常是這些問題都與編譯器有關。我的意思是,當需要編譯器時,我通常會遇到這些問題,我會安裝它,將它添加到路徑中,它可以與許多其他程序一起使用,但不適用於我實際需要的程序。無論如何,感謝您的建議,將來在購買新機器時一定會考慮到這一點。 – mickkk
這正是我所說的。我在windows下使用theano很多,但總是發生一些事情,並且總是用某種聰明的黑客方式解決它們,但是我後來意識到它花費更多,然後我馬上轉移到Linux。我是對的。而且它使用同一臺機器也更快...... – Geeocode