一、TensorFlow 2.0 vs 1.0
对比举例:
1、TensorFlo 1.x(2015年开源)
- session.run()
- 全局化
- sessions
- API混乱
总的来说,tensorflow1.0存在文档和接口混乱、默认占用所有GPU的所有内存、使用繁琐、调试困难等问题。
2、TensorFlow 2.x(2019年2.0发布)
- Eager execution
- 不在全局化
- Functions
- API清理
TensorFlow 2.0删除了冗余API,使API更加一致(统一RNN,统一优化器),并通过Eager Execution更好地与Python运行时集成。
二、TensorFlow 2.0变化
TesorFlow2.0推荐使用tf.keras,tf.data 等高层库:
- 用Eager模式搭建原型
- 用tf.data处理数据
- 用tf.feature_column提取特征
- 用tf.keras搭建模型
- 用tf.saved_model打包模型
Original: https://blog.csdn.net/weixin_47408850/article/details/124110573
Author: 小鹿~
Title: TensorFlow 2.0 与 1.0 的区别与联系
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/496654/
转载文章受原作者版权保护。转载请注明原作者出处!