import tensorflow as tf flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app'
Try to use: import tensorflow.compat.v1 as tf
import tensorflow.compat.v1 as tf