{
  "id": 313440,
  "title": "Need help! Error opening: file opening error, csv and train folder file name miss match",
  "url": "/competitions/kaggle-pog-series-s01e02/discussion/313440",
  "author_name": "",
  "post_date": "2022-03-17T05:35:10.803338900Z",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Im not sure if im doing something wrong here, but when reading the files from the <code>train.csv</code> file it is giving an error saying,</p>\n<p><code>FileNotFoundError: [Errno 2] No such file or directory: '../input/kaggle-pog-series-s01e02train/011170.ogg'</code></p>\n<p>I was just trying to train a model and when the training loop started it was throwing this error. Then I thought let's check out what file paths are not present and visualize few files by plotting,</p>\n<p>I used this code, I tried with other files too, but still the same error. </p>\n<pre><code>file_path = DIR + df[\"filepath\"].iloc[3]\ny_data, sr = librosa.load(file_path)\nplt.figure(figsize=(18,6))\nplt.plot(y_data)\n</code></pre>\n<p>I think the train folder file names have been altered. <br>\nI need help I can't understand what's going wrong.</p>",
  "messages": [
    {
      "id": "1725452",
      "postDate": "03/17/2022 05:35:10",
      "content": "<p>Im not sure if im doing something wrong here, but when reading the files from the <code>train.csv</code> file it is giving an error saying,</p>\n<p><code>FileNotFoundError: [Errno 2] No such file or directory: '../input/kaggle-pog-series-s01e02train/011170.ogg'</code></p>\n<p>I was just trying to train a model and when the training loop started it was throwing this error. Then I thought let's check out what file paths are not present and visualize few files by plotting,</p>\n<p>I used this code, I tried with other files too, but still the same error. </p>\n<pre><code>file_path = DIR + df[\"filepath\"].iloc[3]\ny_data, sr = librosa.load(file_path)\nplt.figure(figsize=(18,6))\nplt.plot(y_data)\n</code></pre>\n<p>I think the train folder file names have been altered. <br>\nI need help I can't understand what's going wrong.</p>",
      "rawMarkdown": "Im not sure if im doing something wrong here, but when reading the files from the `train.csv` file it is giving an error saying,\n\n`FileNotFoundError: [Errno 2] No such file or directory: '../input/kaggle-pog-series-s01e02train/011170.ogg'`\n\nI was just trying to train a model and when the training loop started it was throwing this error. Then I thought let's check out what file paths are not present and visualize few files by plotting,\n\nI used this code, I tried with other files too, but still the same error. \n\n```python\nfile_path = DIR + df[\"filepath\"].iloc[3]\ny_data, sr = librosa.load(file_path)\nplt.figure(figsize=(18,6))\nplt.plot(y_data)\n```\n\nI think the train folder file names have been altered. \nI need help I can't understand what's going wrong.",
      "votes": null
    },
    {
      "id": "1725834",
      "postDate": "03/17/2022 13:20:40",
      "content": "<p>Hi,</p>\n<p>It is strange, did you scan all the files in the folder? maybe the train dataset is somehow deleted or something</p>",
      "rawMarkdown": "Hi,\n\nIt is strange, did you scan all the files in the folder? maybe the train dataset is somehow deleted or something",
      "votes": null
    },
    {
      "id": "1725843",
      "postDate": "03/17/2022 13:27:50",
      "content": "<p>Looks like you are missing a slash between the competition folder and the <code>train</code> folder:</p>\n<p><code>'../input/kaggle-pog-series-s01e02train/011170.ogg'</code></p>\n<p>should be</p>\n<p><code>'../input/kaggle-pog-series-s01e02/train/011170.ogg'</code></p>",
      "rawMarkdown": "Looks like you are missing a slash between the competition folder and the `train` folder:\n\n`'../input/kaggle-pog-series-s01e02train/011170.ogg'`\n\nshould be\n\n`'../input/kaggle-pog-series-s01e02/train/011170.ogg'`",
      "votes": null
    },
    {
      "id": "1725844",
      "postDate": "03/17/2022 13:27:59",
      "content": "<p><a href=\"https://www.kaggle.com/soumya9977\" target=\"_blank\">@soumya9977</a> You're reading .ogg file using train.csv? Obviously that won't work dear. <br>\nFor reading .ogg file you can either convert and import it as .wav or if you wish to load it in .ogg itself then you'll have to import soundfile or simply as: </p>\n<p>Import IPython.display<br>\nIPython.display.Audio(train_sound = \"../input/kaggle-pog-series-s01e02train/011170.ogg\")<br>\nHope it helps! Let me know if it throws on any other error. </p>",
      "rawMarkdown": "soumya9977 You're reading .ogg file using train.csv? Obviously that won't work dear. \nFor reading .ogg file you can either convert and import it as .wav or if you wish to load it in .ogg itself then you'll have to import soundfile or simply as: \n\nImport IPython.display\nIPython.display.Audio(train_sound = \"../input/kaggle-pog-series-s01e02train/011170.ogg\")\nHope it helps! Let me know if it throws on any other error.",
      "votes": null
    },
    {
      "id": "1726085",
      "postDate": "03/17/2022 16:34:01",
      "content": "<p>Im feeling so stupid rn! Did not notice that, I'm very sorry.<br>\nBut there are definitely a few missing files,<br>\n<img src=\"https://i.imgur.com/ZnPfXJP.png\"></p>",
      "rawMarkdown": "Im feeling so stupid rn! Did not notice that, I'm very sorry.\nBut there are definitely a few missing files,\n<img width=\"500\" src=\"https://i.imgur.com/ZnPfXJP.png\">",
      "votes": null
    },
    {
      "id": "1726092",
      "postDate": "03/17/2022 16:38:26",
      "content": "<p>Check this thread: <a href=\"https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486\" target=\"_blank\">https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486</a></p>",
      "rawMarkdown": "Check this thread: https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486",
      "votes": null
    },
    {
      "id": "1726094",
      "postDate": "03/17/2022 16:38:35",
      "content": "<p>Thanks for that, but we can read a .ogg file without converting it into a .wav file. you can use librosa or torch audio for that. I did not try <code>soundfile</code> though, will try that.<br>\neg, librosa:<br>\n<code>y_data, sr = librosa.load(../input/kaggle-pog-series-s01e02/train/011170.ogg)</code></p>",
      "rawMarkdown": "Thanks for that, but we can read a .ogg file without converting it into a .wav file. you can use librosa or torch audio for that. I did not try `soundfile` though, will try that.\neg, librosa:\n`y_data, sr = librosa.load(../input/kaggle-pog-series-s01e02/train/011170.ogg)`",
      "votes": null
    },
    {
      "id": "1726095",
      "postDate": "03/17/2022 16:39:57",
      "content": "<p>got it, thanks 🙇‍♂️</p>",
      "rawMarkdown": "got it, thanks 🙇‍♂️",
      "votes": null
    },
    {
      "id": "1726112",
      "postDate": "03/17/2022 16:57:08",
      "content": "<p>\"Either-or\" since it is convenient for many to do it that way. <br>\nObviously you can import using the librosa and there are certain other ways to perform the same task. ^_^</p>",
      "rawMarkdown": "\"Either-or\" since it is convenient for many to do it that way. \nObviously you can import using the librosa and there are certain other ways to perform the same task. ^_^",
      "votes": null
    },
    {
      "id": "1743557",
      "postDate": "04/03/2022 05:04:25",
      "content": "<p>Yes, the thread mention by <a href=\"https://www.kaggle.com/robikscube\" target=\"_blank\">@robikscube</a> is very helpful. <a href=\"https://www.kaggle.com/soumya9977\" target=\"_blank\">@soumya9977</a> You can avoid all of the missing files using:</p>\n<p>`excluded_files = ['train/003071.ogg', 'train/003137.ogg', 'train/004040.ogg', 'train/009963.ogg',<br>\n       'train/011088.ogg', 'train/013954.ogg', 'train/015980.ogg', 'train/016312.ogg',<br>\n       'train/017940.ogg', 'train/022295.ogg', 'train/022698.ogg', 'train/023078.ogg',<br>\n       'train/024899.ogg']</p>\n<p>for song in tqdm(train_reduced.values):<br>\n        if song[2] not in excluded_files:<br>\n            #write your code here`</p>",
      "rawMarkdown": "Yes, the thread mention by @robikscube is very helpful. @soumya9977 You can avoid all of the missing files using:\n\n`excluded_files = ['train/003071.ogg', 'train/003137.ogg', 'train/004040.ogg', 'train/009963.ogg',\n       'train/011088.ogg', 'train/013954.ogg', 'train/015980.ogg', 'train/016312.ogg',\n       'train/017940.ogg', 'train/022295.ogg', 'train/022698.ogg', 'train/023078.ogg',\n       'train/024899.ogg']\n\nfor song in tqdm(train_reduced.values):\n        if song[2] not in excluded_files:\n            #write your code here`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1725834,
      "author_name": "franksunp",
      "author_url": "",
      "post_date": "03/17/2022 13:20:40",
      "content": "<p>Hi,</p>\n<p>It is strange, did you scan all the files in the folder? maybe the train dataset is somehow deleted or something</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1725843,
      "author_name": "robikscube",
      "author_url": "",
      "post_date": "03/17/2022 13:27:50",
      "content": "<p>Looks like you are missing a slash between the competition folder and the <code>train</code> folder:</p>\n<p><code>'../input/kaggle-pog-series-s01e02train/011170.ogg'</code></p>\n<p>should be</p>\n<p><code>'../input/kaggle-pog-series-s01e02/train/011170.ogg'</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 1726085,
          "author_name": "soumya9977",
          "author_url": "",
          "post_date": "03/17/2022 16:34:01",
          "content": "<p>Im feeling so stupid rn! Did not notice that, I'm very sorry.<br>\nBut there are definitely a few missing files,<br>\n<img src=\"https://i.imgur.com/ZnPfXJP.png\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1726092,
          "author_name": "robikscube",
          "author_url": "",
          "post_date": "03/17/2022 16:38:26",
          "content": "<p>Check this thread: <a href=\"https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486\" target=\"_blank\">https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1726095,
          "author_name": "soumya9977",
          "author_url": "",
          "post_date": "03/17/2022 16:39:57",
          "content": "<p>got it, thanks 🙇‍♂️</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1743557,
          "author_name": "neelnirajjoshi",
          "author_url": "",
          "post_date": "04/03/2022 05:04:25",
          "content": "<p>Yes, the thread mention by <a href=\"https://www.kaggle.com/robikscube\" target=\"_blank\">@robikscube</a> is very helpful. <a href=\"https://www.kaggle.com/soumya9977\" target=\"_blank\">@soumya9977</a> You can avoid all of the missing files using:</p>\n<p>`excluded_files = ['train/003071.ogg', 'train/003137.ogg', 'train/004040.ogg', 'train/009963.ogg',<br>\n       'train/011088.ogg', 'train/013954.ogg', 'train/015980.ogg', 'train/016312.ogg',<br>\n       'train/017940.ogg', 'train/022295.ogg', 'train/022698.ogg', 'train/023078.ogg',<br>\n       'train/024899.ogg']</p>\n<p>for song in tqdm(train_reduced.values):<br>\n        if song[2] not in excluded_files:<br>\n            #write your code here`</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1725844,
      "author_name": "surajjha101",
      "author_url": "",
      "post_date": "03/17/2022 13:27:59",
      "content": "<p><a href=\"https://www.kaggle.com/soumya9977\" target=\"_blank\">@soumya9977</a> You're reading .ogg file using train.csv? Obviously that won't work dear. <br>\nFor reading .ogg file you can either convert and import it as .wav or if you wish to load it in .ogg itself then you'll have to import soundfile or simply as: </p>\n<p>Import IPython.display<br>\nIPython.display.Audio(train_sound = \"../input/kaggle-pog-series-s01e02train/011170.ogg\")<br>\nHope it helps! Let me know if it throws on any other error. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1726094,
          "author_name": "soumya9977",
          "author_url": "",
          "post_date": "03/17/2022 16:38:35",
          "content": "<p>Thanks for that, but we can read a .ogg file without converting it into a .wav file. you can use librosa or torch audio for that. I did not try <code>soundfile</code> though, will try that.<br>\neg, librosa:<br>\n<code>y_data, sr = librosa.load(../input/kaggle-pog-series-s01e02/train/011170.ogg)</code></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1726112,
          "author_name": "surajjha101",
          "author_url": "",
          "post_date": "03/17/2022 16:57:08",
          "content": "<p>\"Either-or\" since it is convenient for many to do it that way. <br>\nObviously you can import using the librosa and there are certain other ways to perform the same task. ^_^</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1725452": "Im not sure if im doing something wrong here, but when reading the files from the `train.csv` file it is giving an error saying,\n\n`FileNotFoundError: [Errno 2] No such file or directory: '../input/kaggle-pog-series-s01e02train/011170.ogg'`\n\nI was just trying to train a model and when the training loop started it was throwing this error. Then I thought let's check out what file paths are not present and visualize few files by plotting,\n\nI used this code, I tried with other files too, but still the same error. \n\n```python\nfile_path = DIR + df[\"filepath\"].iloc[3]\ny_data, sr = librosa.load(file_path)\nplt.figure(figsize=(18,6))\nplt.plot(y_data)\n```\n\nI think the train folder file names have been altered. \nI need help I can't understand what's going wrong.",
    "1725834": "Hi,\n\nIt is strange, did you scan all the files in the folder? maybe the train dataset is somehow deleted or something",
    "1725843": "Looks like you are missing a slash between the competition folder and the `train` folder:\n\n`'../input/kaggle-pog-series-s01e02train/011170.ogg'`\n\nshould be\n\n`'../input/kaggle-pog-series-s01e02/train/011170.ogg'`",
    "1725844": "soumya9977 You're reading .ogg file using train.csv? Obviously that won't work dear. \nFor reading .ogg file you can either convert and import it as .wav or if you wish to load it in .ogg itself then you'll have to import soundfile or simply as: \n\nImport IPython.display\nIPython.display.Audio(train_sound = \"../input/kaggle-pog-series-s01e02train/011170.ogg\")\nHope it helps! Let me know if it throws on any other error.",
    "1726085": "Im feeling so stupid rn! Did not notice that, I'm very sorry.\nBut there are definitely a few missing files,\n<img width=\"500\" src=\"https://i.imgur.com/ZnPfXJP.png\">",
    "1726092": "Check this thread: https://www.kaggle.com/c/kaggle-pog-series-s01e02/discussion/312486",
    "1726094": "Thanks for that, but we can read a .ogg file without converting it into a .wav file. you can use librosa or torch audio for that. I did not try `soundfile` though, will try that.\neg, librosa:\n`y_data, sr = librosa.load(../input/kaggle-pog-series-s01e02/train/011170.ogg)`",
    "1726095": "got it, thanks 🙇‍♂️",
    "1726112": "\"Either-or\" since it is convenient for many to do it that way. \nObviously you can import using the librosa and there are certain other ways to perform the same task. ^_^",
    "1743557": "Yes, the thread mention by @robikscube is very helpful. @soumya9977 You can avoid all of the missing files using:\n\n`excluded_files = ['train/003071.ogg', 'train/003137.ogg', 'train/004040.ogg', 'train/009963.ogg',\n       'train/011088.ogg', 'train/013954.ogg', 'train/015980.ogg', 'train/016312.ogg',\n       'train/017940.ogg', 'train/022295.ogg', 'train/022698.ogg', 'train/023078.ogg',\n       'train/024899.ogg']\n\nfor song in tqdm(train_reduced.values):\n        if song[2] not in excluded_files:\n            #write your code here`"
  },
  "source": "meta"
}