|
Spyder測試 TensorFlow和Keras 1.71
程式碼 import tensorflow as tf print(tf.__version__) import keras print(keras.__version__)
出現以下錯誤:
Python 3.6.10 |Anaconda, Inc.| (default, May 7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.
IPython 7.13.0 -- An enhanced Interactive Python.
runfile('C:/Users/USER/.spyder-py3/temp.py', wdir='C:/Users/USER/.spyder-py3') Traceback (most recent call last):
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file)
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\imp.py", line 343, in load_dynamic return _load(spec)
ImportError: DLL load failed: 動態連結程式庫 (DLL) 初始化例行程序失敗。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\USER\.spyder-py3\temp.py", line 1, in <module> import tensorflow as tf
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\__init__.py", line 41, in <module> from tensorflow.python.tools import module_util as _module_util
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module> from tensorflow.python import pywrap_tensorflow
File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module> raise ImportError(msg)
ImportError: Traceback (most recent call last): File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\USER\.conda\envs\tensorflowenv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\USER\.conda\envs\tensorflowenv\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\USER\.conda\envs\tensorflowenv\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: 動態連結程式庫 (DLL) 初始化例行程序失敗。
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. |