"import keras"和"import keras"之间有什么区别和"import tensorflow.keras"; [英] what's the difference between "import keras" and "import tensorflow.keras"

查看:1028
本文介绍了"import keras"和"import keras"之间有什么区别和"import tensorflow.keras";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,使用import tensorflow.keras从tensorflow导入keras或仅点安装pip安装keras并使用import keras进行导入之间有什么区别,因为到目前为止两者似乎都工作得很好,我注意到的唯一区别是我得到了每次我使用keras执行命令时,在命令行中Using TensorFlow backend..

I was wondering, what's the difference between importing keras from tensorflow using import tensorflow.keras or just pip installing keras alone and importing it using import keras as both seemed to work nicely so far, the only difference I noticed is that i get Using TensorFlow backend. in the command line every time I execute the one using keras.

推荐答案

Tensorflow.keras是Keras API的一个版本,专门用于Tensorflow.它是Tensorflow回购的一部分,从TF 2.0版开始,它将取代tf.layersslim成为主要的高级API.

Tensorflow.keras is an version of Keras API implemented specifically for use with Tensorflow. It is a part of Tensorflow repo and from TF version 2.0 will become main high level API replacing tf.layers and slim.

使用独立keras的唯一原因是维护与框架无关的代码,即与另一个后端一起使用.

The only reason to use standalone keras is to maintain framework-agnostic code, i.e. use it with another backend.

这篇关于"import keras"和"import keras"之间有什么区别和"import tensorflow.keras";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆