import tensorflow as tf
tf.enable_eager_execution()
or
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
tf.enable_eager_execution()
这段博客介绍了如何在TensorFlow中启用或禁用V2行为,并特别强调了使用`tf.enable_eager_execution()`来激活即时执行模式,该模式允许在不构建计算图的情况下直接运行操作,提高开发效率。
import tensorflow as tf
tf.enable_eager_execution()
or
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
tf.enable_eager_execution()

被折叠的 条评论
为什么被折叠?