tensorflow2.0使用1.x模块

674 阅读1分钟

It is still possible to run 1.X code, unmodified (except for contrib), in TensorFlow 2.0:

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

除了tensorflow.contrib外1.x的代码基本都能用了