tensorflow2兼容tensorflow1

替换代码:

import tensorflow as tf

修改为:

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
原文地址:https://www.cnblogs.com/wioponsen/p/14011818.html