py3.7.4版本,其中的代碼涉及到scikit learn,TensorFlow,keras, pandas ,numpy。----CPU環境
其他包安裝都正常,就是TensorFlow安裝時折騰了點。。后面安裝完畢后,運行代碼,發現報錯:ImportError: DLL load failed with error code 3221225501。---網搜了各種辦法,把tf的版本降低到1.12.0.也沒法解決。
因為是要搭建環境,需要進行離線安裝。tensorflow的包名是:
tensorflow-1.13.1-cp37-cp37m-win_amd64.whl,安裝成功,但是運行代碼報錯。
后面改成:
tensorflow-1.12.0-cp37-cp37m-win_amd64.whl,安裝成功,仍舊是同樣問題。。求指點,該如何解決。。。最好不要讓我降python的版本。。。
具體錯誤內容如下:
Traceback (most recent call last):
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", lin
e 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal
.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal
.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
File "D:\python\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "D:\python\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code 3221225501
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\python\Desktop\test.py", line 7, in <module>
from keras.models import Sequential
File "D:\python\lib\site-packages\keras__init__.py", line 3, in <module>
from . import utils
File "D:\python\lib\site-packages\keras\utils__init__.py", line 6, in <module
from . import conv_utils
File "D:\python\lib\site-packages\keras\utils\conv_utils.py", line 9, in <modu
le>
from .. import backend as K
File "D:\python\lib\site-packages\keras\backend__init__.py", line 89, in <mod
ule>
from .tensorflow_backend import *
File "D:\python\lib\site-packages\keras\backend\tensorflow_backend.py", line 5
, in <module>
import tensorflow as tf
File "D:\python\lib\site-packages\tensorflow__init__.py", line 24, in <module
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-im
port
File "D:\python\lib\site-packages\tensorflow\python__init__.py", line 49, in
<module>
from tensorflow.python import pywrap_tensorflow
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", lin
e 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", lin
e 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal
.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal
.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
File "D:\python\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "D:\python\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code 3221225501
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
uj5u.com熱心網友回復:
樓主解決了嗎?我也遇到了相同的問題,Win7環境uj5u.com熱心網友回復:
大神!問題解決了嗎?uj5u.com熱心網友回復:
win7 python 3.7.4 也遇到一樣的問題,請問有人解決了嗎uj5u.com熱心網友回復:
有誰解決了嗎,遇到同樣問題uj5u.com熱心網友回復:
應該是CPU不支持tensorflow,tensorflow會使用CPU的AVX指令集轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/31518.html
標籤:其他技術討論專區
上一篇:WPF 樣式的一個問題
