title: IOError: [Errno 21] Is a directory: '/tmp/speech_dataset/'
body: <p>I'm following the speech recognition tutorial from TensorFlow(link: <a href="https://www.tensorflow.org/versions/master/tutorials/audio_recognition#advanced_training" rel="nofollow noreferrer">https://www.tensorflow.org/versions/master/tutorials/audio_recognition#advanced_training</a>), and when I'm running the following command, which downloads the dataset provided by TensorFlow, it runs perfectly.</p>
  
  <pre><code>python tensorflow/examples/speech_commands/train.py
  </code></pre>
  
  <p>However, when I'm changing the defaults, so that it points to my dataset, it throws the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/users2/lmn/.local/lib/python2.7/site-packages/tensorflow/examples/speech_commands/train.py", line 428, in &lt;module&gt;
      tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
    File "/home/users2/lmn/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 126, in run
      _sys.exit(main(argv))
    File "/home/users2/lmn/.local/lib/python2.7/site-packages/tensorflow/examples/speech_commands/train.py", line 106, in main
      FLAGS.testing_percentage, model_settings)
    File "/home/users2/lmn/.local/lib/python2.7/site-packages/tensorflow/examples/speech_commands/input_data.py", line 158, in __init__
      self.maybe_download_and_extract_dataset(data_url, data_dir)
    File "/home/users2/lmn/.local/lib/python2.7/site-packages/tensorflow/examples/speech_commands/input_data.py", line 204, in maybe_download_and_extract_dataset
      tarfile.open(filepath, 'r:gz').extractall(dest_directory)
    File "/usr/lib64/python2.7/tarfile.py", line 1693, in open
      return func(name, filemode, fileobj, **kwargs)
    File "/usr/lib64/python2.7/tarfile.py", line 1740, in gzopen
      fileobj = gzip.GzipFile(name, mode, compresslevel, fileobj)
    File "/usr/lib64/python2.7/gzip.py", line 94, in __init__
      fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
  IOError: [Errno 21] Is a directory: '/tmp/speech_dataset/' 
  </code></pre>
  
  <p>The command I'm running is:</p>
  
  <pre><code>python tensorflow/examples/speech_commands/train.py --data_url=path/to/data/ --sample_rate=20000 --wanted_words=one,two,three,four,five,six,seven,eight,nine
  </code></pre>
  
  <p>Now, the error says that '/tmp/speech_dataset/' is a directory, but it is expecting a file, I guess. When I looked at <code>train.py</code> file, found the following code:</p>
  
  <pre><code>parser.add_argument(
        '--data_dir',
        type=str,
        default='/tmp/speech_dataset/',
        help="""\
        Where to download the speech training data to.
        """)
  </code></pre>
  
  <p>The <code>--data-dir</code> argument defines where the files from the downloaded dataset should be stored. However, I'm not changing at at all, nor does the code need to save any data, since I already have the data on my computer, where I define them at <code>--data-url</code> argument. It seems to me that this is a bug from TensorFlow. </p>
  
  <p>Does anyone has experience with speech recognition on TensorFlow and know where the problem might be?</p>
  
  <p>Thank you in advance!</p>