{
  "id": 45019,
  "title": "Error: \"Data too short when trying to read value\"",
  "url": "/competitions/tensorflow-speech-recognition-challenge/discussion/45019",
  "author_name": "",
  "post_date": "2017-12-05T14:16:39.233744200Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I am trying to run the default TF implementation using convnets on the dataset. The command I am using is this: <code>python tensorflow/tensorflow/examples/speech_commands/train.py --data_dir=/data/train/audio --wanted_words=bed,bird,cat,dog,down,eight,five,four,go,happy,house,left,marvin,nine,no,off,on,one,right,seven,sheila,six,stop,three,tree,two,up,wow,yes,zero --data_url=\"\"</code>. However, when I run this, I get this error: <code>Error: \"Data too short when trying to read value\"</code>.</p>\n\n<p>I suspect it is something to do with the length of an audio file since when I trace back through the code, I see this config being set up: <code>desired_samples = int(sample_rate * clip_duration_ms / 1000)</code>. Are there audio samples less than the 1.0 second duration?</p>",
  "messages": [
    {
      "id": "253707",
      "postDate": "12/05/2017 14:16:39",
      "content": "<p>I am trying to run the default TF implementation using convnets on the dataset. The command I am using is this: <code>python tensorflow/tensorflow/examples/speech_commands/train.py --data_dir=/data/train/audio --wanted_words=bed,bird,cat,dog,down,eight,five,four,go,happy,house,left,marvin,nine,no,off,on,one,right,seven,sheila,six,stop,three,tree,two,up,wow,yes,zero --data_url=\"\"</code>. However, when I run this, I get this error: <code>Error: \"Data too short when trying to read value\"</code>.</p>\n\n<p>I suspect it is something to do with the length of an audio file since when I trace back through the code, I see this config being set up: <code>desired_samples = int(sample_rate * clip_duration_ms / 1000)</code>. Are there audio samples less than the 1.0 second duration?</p>",
      "rawMarkdown": "I am trying to run the default TF implementation using convnets on the dataset. The command I am using is this: `python tensorflow/tensorflow/examples/speech_commands/train.py --data_dir=/data/train/audio --wanted_words=bed,bird,cat,dog,down,eight,five,four,go,happy,house,left,marvin,nine,no,off,on,one,right,seven,sheila,six,stop,three,tree,two,up,wow,yes,zero --data_url=\"\"`. However, when I run this, I get this error: `Error: \"Data too short when trying to read value\"`.\n\nI suspect it is something to do with the length of an audio file since when I trace back through the code, I see this config being set up: `desired_samples = int(sample_rate * clip_duration_ms / 1000)`. Are there audio samples less than the 1.0 second duration?",
      "votes": null
    },
    {
      "id": "253992",
      "postDate": "12/06/2017 01:46:28",
      "content": "<p>In the train set, 58,252 of the 64,721 files are exactly 1 second long.  The rest are shorter than 1 second.</p>\n\n<p>You might check out this thread:  <a href=\"https://www.kaggle.com/c/tensorflow-speech-recognition-challenge/discussion/44687\">One training file repeated 3709 times in test!</a> </p>\n\n<p>The <a href=\"https://storage.googleapis.com/kaggle-forum-message-attachments/251419/7997/00-WAV-File-Inventory.html\">HTML version of the Jupyter notebook</a> using R shows just less than 10% of the files are shorter than one second (16000 samples).</p>\n\n<p>There is a file at the bottom of the article that can be downloaded (train-Kaggle-Speech-Recognition-File-Inventory.csv) that shows the number of samples in all the train files.  The samples columns is  &lt; 16000 for files shorter than one second.</p>\n\n<p>All of the test set files are exactly 1 second long (16000 samples).</p>",
      "rawMarkdown": "In the train set, 58,252 of the 64,721 files are exactly 1 second long.  The rest are shorter than 1 second.\n\nYou might check out this thread:  [One training file repeated 3709 times in test!][1] \n\nThe [HTML version of the Jupyter notebook][2] using R shows just less than 10% of the files are shorter than one second (16000 samples).\n\nThere is a file at the bottom of the article that can be downloaded (train-Kaggle-Speech-Recognition-File-Inventory.csv) that shows the number of samples in all the train files.  The samples columns is  &lt; 16000 for files shorter than one second.\n\n  [1]: https://www.kaggle.com/c/tensorflow-speech-recognition-challenge/discussion/44687\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/251419/7997/00-WAV-File-Inventory.html\n\nAll of the test set files are exactly 1 second long (16000 samples).",
      "votes": null
    },
    {
      "id": "257443",
      "postDate": "12/14/2017 08:49:41",
      "content": "<p>Yes there are some samples that are short. If you are using preprocessing methods such as Spectogram, then you will notice that some of them are actually lesser in length. You can append zeros at the start of the audio, thus those with lesser length with start with zeros (i.e. no sound) followed by the actual audio.. This will make all the audio files of same length.</p>\n\n<p>Hope this helps.</p>",
      "rawMarkdown": "Yes there are some samples that are short. If you are using preprocessing methods such as Spectogram, then you will notice that some of them are actually lesser in length. You can append zeros at the start of the audio, thus those with lesser length with start with zeros (i.e. no sound) followed by the actual audio.. This will make all the audio files of same length.\n\nHope this helps.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 253992,
      "author_name": "efglynn",
      "author_url": "",
      "post_date": "12/06/2017 01:46:28",
      "content": "<p>In the train set, 58,252 of the 64,721 files are exactly 1 second long.  The rest are shorter than 1 second.</p>\n\n<p>You might check out this thread:  <a href=\"https://www.kaggle.com/c/tensorflow-speech-recognition-challenge/discussion/44687\">One training file repeated 3709 times in test!</a> </p>\n\n<p>The <a href=\"https://storage.googleapis.com/kaggle-forum-message-attachments/251419/7997/00-WAV-File-Inventory.html\">HTML version of the Jupyter notebook</a> using R shows just less than 10% of the files are shorter than one second (16000 samples).</p>\n\n<p>There is a file at the bottom of the article that can be downloaded (train-Kaggle-Speech-Recognition-File-Inventory.csv) that shows the number of samples in all the train files.  The samples columns is  &lt; 16000 for files shorter than one second.</p>\n\n<p>All of the test set files are exactly 1 second long (16000 samples).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 257443,
      "author_name": "dhayalkarsahilr",
      "author_url": "",
      "post_date": "12/14/2017 08:49:41",
      "content": "<p>Yes there are some samples that are short. If you are using preprocessing methods such as Spectogram, then you will notice that some of them are actually lesser in length. You can append zeros at the start of the audio, thus those with lesser length with start with zeros (i.e. no sound) followed by the actual audio.. This will make all the audio files of same length.</p>\n\n<p>Hope this helps.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "253707": "I am trying to run the default TF implementation using convnets on the dataset. The command I am using is this: `python tensorflow/tensorflow/examples/speech_commands/train.py --data_dir=/data/train/audio --wanted_words=bed,bird,cat,dog,down,eight,five,four,go,happy,house,left,marvin,nine,no,off,on,one,right,seven,sheila,six,stop,three,tree,two,up,wow,yes,zero --data_url=\"\"`. However, when I run this, I get this error: `Error: \"Data too short when trying to read value\"`.\n\nI suspect it is something to do with the length of an audio file since when I trace back through the code, I see this config being set up: `desired_samples = int(sample_rate * clip_duration_ms / 1000)`. Are there audio samples less than the 1.0 second duration?",
    "253992": "In the train set, 58,252 of the 64,721 files are exactly 1 second long.  The rest are shorter than 1 second.\n\nYou might check out this thread:  [One training file repeated 3709 times in test!][1] \n\nThe [HTML version of the Jupyter notebook][2] using R shows just less than 10% of the files are shorter than one second (16000 samples).\n\nThere is a file at the bottom of the article that can be downloaded (train-Kaggle-Speech-Recognition-File-Inventory.csv) that shows the number of samples in all the train files.  The samples columns is  &lt; 16000 for files shorter than one second.\n\n  [1]: https://www.kaggle.com/c/tensorflow-speech-recognition-challenge/discussion/44687\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/251419/7997/00-WAV-File-Inventory.html\n\nAll of the test set files are exactly 1 second long (16000 samples).",
    "257443": "Yes there are some samples that are short. If you are using preprocessing methods such as Spectogram, then you will notice that some of them are actually lesser in length. You can append zeros at the start of the audio, thus those with lesser length with start with zeros (i.e. no sound) followed by the actual audio.. This will make all the audio files of same length.\n\nHope this helps."
  },
  "source": "meta"
}