Python 无法加载本机TensorFlow运行时?
我从keras执行Python 无法加载本机TensorFlow运行时?,python,tensorflow,keras,anaconda,Python,Tensorflow,Keras,Anaconda,我从keras执行时遇到以下错误。模型导入顺序 ~\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py 在里面 81因为一些常见的原因和解决方案。包括整个堆栈跟踪 请求帮助时,请在上面显示此错误消息。“%traceback.format_exc() --->83.恐怖主义(味精) 84 85#pylint:enable=通配符导入,g-import-not-at-top,未使用的导入,行太长 ImportErr
时遇到以下错误。模型导入顺序
~\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py
在里面
81因为一些常见的原因和解决方案。包括整个堆栈跟踪
请求帮助时,请在上面显示此错误消息。“%traceback.format_exc()
--->83.恐怖主义(味精)
84
85#pylint:enable=通配符导入,g-import-not-at-top,未使用的导入,行太长
ImportError:回溯(最近一次调用上次):文件
“C:\Users\joe\Anaconda3\lib\site packages\tensorflow\python\pywrap\u tensorflow.py”,
第64行,在
从tensorflow.python.\u pywrap\u tensorflow\u内部导入*导入错误:DLL加载失败:找不到指定的模块
未能加载本机TensorFlow运行时
这是pip冻结的结果
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.12
anaconda-project==0.8.3
....
conda==4.9.2
conda-build==3.18.11
Keras==2.3.1
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing==1.1.2
tensorflow==2.3.1
tensorflow-estimator==2.3.0
jupyter-core==4.6.3
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing==1.1.0
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
根据我在下面尝试的答案
conda create -n gpu_env tensorflow-gpu
conda activate gpu_env
在pip冻结时给出以下结果
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.12
anaconda-project==0.8.3
....
conda==4.9.2
conda-build==3.18.11
Keras==2.3.1
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing==1.1.2
tensorflow==2.3.1
tensorflow-estimator==2.3.0
jupyter-core==4.6.3
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing==1.1.0
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
但是,当我打开jupyter笔记本并执行程序时,会出现相同的错误。不确定这里有什么问题?我可以用
pip uninstall tensorflow
pip install tensorflow==1.15
您正在使用它将支持的Anaconda
Tensorflow==2.1.0
Keras==2.3.1
为tensorflow创建新环境
conda create -n tf tensorflow
activate tf
然后安装keras
pip install keras==2.3.1