简体   繁体   English

keras 已安装但无法加载

[英]keras installed but can't be loaded

I am new to using keras or tensorflow.我不熟悉使用 keras 或 tensorflow。

I first used conda install keras in Anaconda Prompt to install keras.我先用conda install keras在 Anaconda 提示安装 keras。 Then I go to Jupyter Notebook to call the keras using import keras or from keras.datasets import mnist .然后我 go 到 Jupyter Notebook 调用 keras 使用import kerasfrom keras.datasets import mnist The error message showed as: No module named 'tensorflow'.错误消息显示为:没有名为“tensorflow”的模块。

I didn't know whether keras must have tensorflow installed, then it can be called.不知道keras是不是一定要安装tensorflow才可以调用。 Then I used conda install tensorflow in Anaconda Prompt again.然后我用conda install tensorflow在 Anaconda 再次提示。 The result was like this:结果是这样的: 在此处输入图像描述

Then I rerun those statement to call keras again in Jupyter Notebook.然后我重新运行这些语句以在 Jupyter Notebook 中再次调用 keras。 Now the error message was: ImportError: DLL load failed: The specified module could not be found.Failed to load the native TensorFlow runtime.现在错误消息是: ImportError: DLL load failed: The specified module could not be found.Failed to load the native TensorFlow runtime.

I didn't know what to do next to solve this problem to use keras.我不知道下一步该怎么做才能使用 keras 来解决这个问题。

Thanks for your help.谢谢你的帮助。

As Keras requires backend framework like Tensorflow you need to install Tensorflow first and then install Keras which will solve the issue.由于 Keras 需要像 Tensorflow 这样的后端框架,因此您需要先安装 Tensorflow,然后再安装 Z7FEE7BB66F4294C3E32783 问题。

After this you can either import keras from import tensorflow.keras or directly import Keras在此之后,您可以从导入 tensorflow.keras 导入 keras或直接导入 Z7FEE7BB66F4294C3E32783EFA7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM