with tf.gfile.GFile(path, 'r') as fid: AttributeError: module 'tensorflow' has no attribute 'gfile' code example
Example 1: AttributeError: module 'tensorflow' has no attribute 'gfile'
import tensorflow.compat.v1 as tf
Example 2: AttributeError: module 'tensorflow' has no attribute 'gfile'
# In TensorFlow 2.0, tf.gfile.* is replaced by tf.io.gfile.*