TensorFlow 2.0+Keras 防坑指南
TensorFlow 2.0是对1.x版本做了一次大的瘦身,Eager Execution默认开启,并且使用Keras作为默认高级API,
这些改进大大降低的TensorFlow使用难度。
本文主要记录了一次曲折的使用Keras+TensorFlow2.0的BatchNormalization的踩坑经历,这个坑差点要把TF2.0的新特性都毁灭殆尽,如果你在学习TF2.0的官方教程,不妨一观。
问题的产生
从教程[1]https://www.tensorflow.org/alpha/tutorials/images/transfer_learning?hl=zh-cn(讲述如何Transfer Learning)说起:
IMG_SHAPE = (IMG_SIZE, IMG_SIZE, 3)
# Create the base model fr