. Advertisement .
..3..
. Advertisement .
..4..
I encountered the following problem in completing my work:
Traceback (most recent call last):
File "generate_tfrecord.py", line 23, in <module>
flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app'
Below is the code I ran:
python3 generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record
What’s causing it, and how can it be resolved in the “attributeerror module tensorflow has no attribute app“ in the python?
The cause: The error “attributeerror module TensorFlow has no attribute app“ may be because your version of Tensorflow is no longer supported and unusable
Solution:
To fix the error, you can use
tf.compat.v1.flags
instead oftf.app.flags
Use
import tensorflow.compat.v1 as tf