最近学习吴恩达老师的深度学习课程,代码以TF1.X为编程工具,但我的版本是TF2.1
会报错,我用以下方法实现不用降版本也可运行
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
#通过代码实现,把1.X版本tf作为tf,表现上表现为tf2 """import tensorflow.compat.v1 as tf tf.disable_v2_behavior()"""
最近学习吴恩达老师的深度学习课程,代码以TF1.X为编程工具,但我的版本是TF2.1
会报错,我用以下方法实现不用降版本也可运行
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
#通过代码实现,把1.X版本tf作为tf,表现上表现为tf2 """import tensorflow.compat.v1 as tf tf.disable_v2_behavior()"""