简体   繁体   English

我是否成功安装了 TensorFlow 和 Keras?

[英]Have I successfully installed TensorFlow and Keras?

On Jupyter Notebook, I have the following code:在 Jupyter Notebook 上,我有以下代码:

!pip install keras
!pip install tensorflow
import tensorflow as tf

Under it, it spits out this after I've ran it.在它下面,我运行它后它会吐出这个。

 Requirement already satisfied: keras in c:\users\nollb\anaconda3\lib\site-packages (2.4.3)
Requirement already satisfied: numpy>=1.9.1 in c:\users\nollb\anaconda3\lib\site-packages (from keras) (1.18.5)
Requirement already satisfied: pyyaml in c:\users\nollb\anaconda3\lib\site-packages (from keras) (5.3.1)
Requirement already satisfied: scipy>=0.14 in c:\users\nollb\anaconda3\lib\site-packages (from keras) (1.5.2)
Requirement already satisfied: h5py in c:\users\nollb\anaconda3\lib\site-packages (from keras) (2.10.0)
Requirement already satisfied: six in c:\users\nollb\anaconda3\lib\site-packages (from h5py->keras) (1.15.0)
Requirement already satisfied: tensorflow in c:\users\nollb\anaconda3\lib\site-packages (2.3.1)
Requirement already satisfied: six>=1.12.0 in c:\users\nollb\anaconda3\lib\site-packages (from tensorflow) (1.15.0)

There's more lines but does this mean keras and tensorflow have been successfully installed and I can start using the packages?还有更多行,但这是否意味着 keras 和 tensorflow 已成功安装,我可以开始使用这些软件包了吗?

Yes, in fact it means that tensorflow and keras had already been installed ("Requirement already satisfied").是的,实际上这意味着tensorflowkeras已经安装(“要求已经满足”)。

You can verify this by running您可以通过运行来验证这一点

python -c 'import tensorflow as tf; print(tf.__version__)'  # for Python 2
python3 -c 'import tensorflow as tf; print(tf.__version__)'  # for Python 3

Note that nowadays it is recommended to use tensorflow.keras which is integrated into tensorflow instead of the standalone keras package. Note that nowadays it is recommended to use tensorflow.keras which is integrated into tensorflow instead of the standalone keras package.

You can also run the following code snippet in your jupyter notebook to check this:您还可以在 jupyter notebook 中运行以下代码片段来检查:

import tensorflow as tf
tf.version.VERSION

import keras
keras.__version__

However, As the output states:但是,正如 output 所述:

Requirement already satisfied: tensorflow 
Requirement already satisfied: keras

Both packages have been installed, and you can start using them!两个包都已经安装好了,可以开始使用了!

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

相关问题 即使已安装TensorFlow和Keras,也可以在Jupyter中导入它们吗? - Can import TensorFlow and Keras in Jupyter, even though I have them installed? 如何测试我是否已成功安装Python模块? - How can I test that I have a Python module successfully installed? Keras 需要 TensorFlow 2.2 或更高版本,我有 tensorflow 2.4 - Keras requires TensorFlow 2.2 or higher,I have tensorflow 2.4 我已经成功安装了 lightgbm 但无法在 jupyter 中运行 - I have installed lightgbm successfully but can't run in jupyter 这个 tensorflow 安装有什么问题? 我已经安装了 tensorflow 的 gpu 版本 - What is wrong in this tensorflow installation? I have installed gpu version of tensorflow 如果我已经安装了Anaconda Python,如何在R中使用TensorFlow? - How to use TensorFlow in R if I have Anaconda Python already installed? 成功安装软件包后,是否应该删除.whl安装程序? - Should I delete .whl installers after packages have successfully been installed? 即使我已经使用pip Linux Mint Sarah成功安装了BeautifulSoup4,它也无法正常工作 - BeautifulSoup4 is not working even though I have successfully installed it using pip Linux Mint Sarah Keras安装的Tensorflow会覆盖Tensorflow-GPU安装 - Tensorflow installed by Keras overrides Tensorflow-GPU Installation keras 已安装但没有后续功能 - keras installed but doesn't have subsequent functions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM