The error mentioned in the title is happening due to the call
FLAGS = tf.app.flags.FLAGS
There are multiple questions related to this:
How could I solve the flags=tensorflow.app.flags error
AttributeError: module 'tensorflow' has no attribute 'app'
It can be learned that it is error caused due to the change in Tensorflow version. But, I don't want to downgrade the Tensorflow version as mentioned in almost all answers since it is causing further error in the code I want to run.
The answer provided here suggested the following solution
from absl import app
if __name__ == '__main__':
app.run(main)
But, it is not working.
Is there any way to modify mode without downgrading Tensorflow version?