title: Getting error when trying to load data using keras.utils.get_file()
body: <p>I am getting an error when trying to load a dataset using TensorFlow Keras. Here is the code:</p>
  <pre><code>dataset_url = &quot;https://storage.googleapis.com/sample_org/sample_file.zip&quot;
  data_dir = tf.keras.utils.get_file(origin=dataset_url, 
                                     fname='sample_file', 
                                     extract=True)
  data_dir = pathlib.Path(data_dir)
  </code></pre>
  <p><strong>I have changed the URL to 'sample_file.zip' for security reasons.</strong></p>
  <p>This is the error that I am getting:</p>
  <pre><code>---------------------------------------------------------------------------
  FileExistsError                           Traceback (most recent call last)
  &lt;ipython-input-12-1cdc186b0389&gt; in &lt;module&gt;()
        2 data_dir = tf.keras.utils.get_file(origin=dataset_url, 
        3                                    fname='sample_file',
  ----&gt; 4                                    extract=True)
        5 data_dir = pathlib.Path(data_dir)
  
  3 frames
  /usr/lib/python3.6/zipfile.py in _extract_member(self, member, targetpath, pwd)
     1572         if member.is_dir():
     1573             if not os.path.isdir(targetpath):
  -&gt; 1574                 os.mkdir(targetpath)
     1575             return targetpath
     1576 
  
  FileExistsError: [Errno 17] File exists: '/root/.keras/datasets/sample_file'
  </code></pre>
  <p>What is causing this error? How can I fix it?</p>
  <p>This is the first block of code run after imports so I don't know why 'FileExistsError' happens.</p>
  <p>I have tried changing the name of the file.</p>
  <p>I have checked TensorFlow documentation and it uses code like this:</p>
  <pre><code>dataset_url = &quot;https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz&quot;
  data_dir = tf.keras.utils.get_file(origin=dataset_url, 
                                     fname='flower_photos', 
                                     untar=True)
  data_dir = pathlib.Path(data_dir)
  </code></pre>
  <p>I have run this above code and it is working. But I cannot figure out why the same code is showing error for my data. Please advice.</p>