title: with AttributeError: module 'tensorflow' has no attribute 'gfile'
body: <p><em><strong>I am trying to build an object detection model with the help of tensorflow and having this error again and again. I tried that tf.io.Gfile also, but it is not helpful. I am using tensorflow 2.2.0 version and tensorflow-GPU 2.2.0 as well. Here is the code,</strong></em></p>
  <p>!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x {IMAGE_PATH + '/train'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/train.record'}</p>
  <p>!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x{IMAGE_PATH + '/test'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/test.record'}</p>
  <p><strong>when I change the tf.gfile to tf.io.gfile, here comes the new error....</strong></p>
  <p>I tried and now facing this....</p>
  <p>Traceback (most recent call last):</p>
  <p>File &quot;Tensorflow/scripts/generate_tfrecord.py&quot;, line 62, in </p>
  <pre><code>label_map_dict = label_map_util.get_label_map_dict(label_map)
  </code></pre>
  <p>File &quot;C:\Users\91880\AppData\Roaming\Python\Python37\site-packages
  \object_detection\utils\label_map_util.py&quot;, line 164, in get_label_map_dict
  label_map = load_labelmap(label_map_path)</p>
  <p>File &quot;C:\Users\91880\AppData\Roaming\Python\Python37\site-packages\object_detection\utils\label_map_util.py&quot;, line 133, in load_labelmap
  label_map_string = fid.read()</p>
  <p>File &quot;C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\lib\io\file_io.py&quot;, line 122, in read
  self._preread_check()</p>
  <p>File &quot;C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\lib\io\file_io.py&quot;, line 84, in _preread_check
  compat.as_bytes(self.__name), 1024 * 512)</p>
  <p>File &quot;C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\util\compat.py&quot;, line 71, in as_bytes
  (bytes_or_text,))</p>
  <p>TypeError: Expected binary or unicode string, got item {</p>
  <p>name: &quot;Namaste&quot;
  id: 1
  }</p>
  <p>item {
  name: &quot;Thanks&quot;
  id: 2
  }</p>
  <p>item {
  name: &quot;Yes&quot;
  id: 3
  }</p>
  <p>item {
  name: &quot;No&quot;
  id: 4
  }</p>
  <p>item {
  name: &quot;Good&quot;
  id: 5
  }</p>