针对 tf2 里面没有 tf1 的相关函数,通过下面处理
tf.compat.v1
该代码就相当于是 tf1 了
举例:
# tf2 直接写这个方法会报错 tf.compat.v1.image.resize_images