问题遇到的现象和发生背景
import tensorflow
import keras
Traceback (most recent call last):
File "", line 1, in
import tensorflow
File "D:\anaconda\anaconda3\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as _module_util
File "D:\anaconda\anaconda3\lib\site-packages\tensorflow\python_init_.py", line 40, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "D:\anaconda\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 80, in
f'{traceback.format_exc()}'
ImportError: Traceback (most recent call last):
File "D:\anaconda\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.
我的解答思路和尝试过的方法
!pip list
Package Version
---------------------------------- ---------显示有
keras 2.7.0
Keras-Preprocessing 1.1.2
keyring 13.2.1
tensorflow 2.7.0
tensorflow-estimator 2.7.0
tensorflow-io-gcs-filesystem 0.22.0
我想要达到的结果
引入
from keras.models import Sequential