{
  "id": 179253,
  "title": "Question to host: are you sure test data sampling is always 32000?",
  "url": "/competitions/birdsong-recognition/discussion/179253",
  "author_name": "CPMP",
  "post_date": "2020-09-02T01:07:08.708000",
  "votes": 13,
  "comment_count": 22,
  "views": 0,
  "content": "<p>I am entering the game of trying to get a successful submission.  First try was a fail.  Second try succeeds with LB score 0.</p>\n<p>The only difference between the two is that in the second one I ignore the sampling rate returned by librosa read and I used 32000.</p>\n<p>It means that the sampling rate in the file is different from 32000 at least once.</p>\n<p>Here is the difference between my two notebooks:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F75976%2Fe99fcf9722ac8f1fa9df3849bd74f623%2FScreenshot_2020-09-02%20infer_model_91.png?generation=1599008039968690&amp;alt=media\" alt=\"\"></p>\n<p>Can the host certify that the test data is sampled at 32000?  <br>\nIn this discussion <a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> says test data \"should be\" sampled at 32000: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049\" target=\"_blank\">https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049</a></p>\n<p>What does \"should be\" mean?  Is it a wish?  Should we resample at this rate?</p>",
  "messages": [
    {
      "id": 994817,
      "postDate": "2020-09-02T01:07:08.710Z",
      "content": "<p>I am entering the game of trying to get a successful submission.  First try was a fail.  Second try succeeds with LB score 0.</p>\n<p>The only difference between the two is that in the second one I ignore the sampling rate returned by librosa read and I used 32000.</p>\n<p>It means that the sampling rate in the file is different from 32000 at least once.</p>\n<p>Here is the difference between my two notebooks:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F75976%2Fe99fcf9722ac8f1fa9df3849bd74f623%2FScreenshot_2020-09-02%20infer_model_91.png?generation=1599008039968690&amp;alt=media\" alt=\"\"></p>\n<p>Can the host certify that the test data is sampled at 32000?  <br>\nIn this discussion <a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> says test data \"should be\" sampled at 32000: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049\" target=\"_blank\">https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049</a></p>\n<p>What does \"should be\" mean?  Is it a wish?  Should we resample at this rate?</p>",
      "rawMarkdown": "I am entering the game of trying to get a successful submission.  First try was a fail.  Second try succeeds with LB score 0.\n\nThe only difference between the two is that in the second one I ignore the sampling rate returned by librosa read and I used 32000.\n\nIt means that the sampling rate in the file is different from 32000 at least once.\n\nHere is the difference between my two notebooks:\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F75976%2Fe99fcf9722ac8f1fa9df3849bd74f623%2FScreenshot_2020-09-02%20infer_model_91.png?generation=1599008039968690&alt=media)\n\nCan the host certify that the test data is sampled at 32000?  \nIn this discussion @stefankahl says test data \"should be\" sampled at 32000: https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049\n\nWhat does \"should be\" mean?  Is it a wish?  Should we resample at this rate?\n\n",
      "votes": 14
    },
    {
      "id": 1008003,
      "postDate": "2020-09-12T17:25:46.103Z",
      "content": "<p>Before we go. <br>\nIts still not clear whether to resample or not to 32kHz. Resampling with kaiser_best takes much time. Resampling with kaiser_fast reduces both local and LB scores slightly (I've tested this). Has anyone tried to run his pipeline on raw librosa.load(…, sr=None) files? </p>",
      "rawMarkdown": "Before we go. \nIts still not clear whether to resample or not to 32kHz. Resampling with kaiser_best takes much time. Resampling with kaiser_fast reduces both local and LB scores slightly (I've tested this). Has anyone tried to run his pipeline on raw librosa.load(..., sr=None) files? ",
      "votes": 3,
      "replies": [
        {
          "id": 1008010,
          "postDate": "2020-09-12T17:27:26.860Z",
          "content": "<p>Is it possible that sr == None and is actually 32kHz so there is redundant resampling? That's why I'm aksing</p>",
          "rawMarkdown": "Is it possible that sr == None and is actually 32kHz so there is redundant resampling? That's why I'm aksing",
          "votes": 1
        },
        {
          "id": 1008036,
          "postDate": "2020-09-12T17:59:43.887Z",
          "content": "<blockquote>\n  <p>reduces both local and LB scores slightly</p>\n</blockquote>\n<p>How big of a drop do you observe ? </p>\n<p>On our side we've been using <code>librosa.load(path, sr=sr, mono=True, res_type=\"kaiser_fast\")</code> the whole time.</p>\n<p>There is this line in the <a href=\"http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/_modules/librosa/core/audio.html#load\" target=\"_blank\">code</a> of the librosa  resample function: </p>\n<pre><code>if orig_sr == target_sr:\n    return y\n</code></pre>\n<p>The performance and runtime difference clearly indicates that some samples have <code>sr != 32 kHz</code> …</p>\n<p><a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> </p>",
          "rawMarkdown": "> reduces both local and LB scores slightly\n\nHow big of a drop do you observe ? \n\nOn our side we've been using `librosa.load(path, sr=sr, mono=True, res_type=\"kaiser_fast\")` the whole time.\n\nThere is this line in the [code](http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/_modules/librosa/core/audio.html#load) of the librosa  resample function: \n```\nif orig_sr == target_sr:\n    return y\n```\n\nThe performance and runtime difference clearly indicates that some samples have `sr != 32 kHz` ...\n\n@stefankahl "
        },
        {
          "id": 1008045,
          "postDate": "2020-09-12T18:02:12.373Z",
          "content": "<p>Last time I've tested it was 603 -&gt; 602. <br>\nThat's very minor but it might cost someone a position or few. </p>",
          "rawMarkdown": "Last time I've tested it was 603 -> 602. \nThat's very minor but it might cost someone a position or few. ",
          "votes": 1
        },
        {
          "id": 1008065,
          "postDate": "2020-09-12T18:15:31.910Z",
          "content": "<p>Thanks for sharing, hopefully this won't affect anyone …</p>",
          "rawMarkdown": "Thanks for sharing, hopefully this won't affect anyone ...",
          "votes": 1
        },
        {
          "id": 1008172,
          "postDate": "2020-09-12T19:47:28.673Z",
          "content": "<blockquote>\n  <p>Has anyone tried to run his pipeline on raw librosa.load(…, sr=None) files? </p>\n</blockquote>\n<p>I did and it fails.  It is why i asked many times host to check that files are correct.</p>",
          "rawMarkdown": "> Has anyone tried to run his pipeline on raw librosa.load(…, sr=None) files? \n\nI did and it fails.  It is why i asked many times host to check that files are correct.",
          "votes": 2
        },
        {
          "id": 1008176,
          "postDate": "2020-09-12T19:50:37.887Z",
          "content": "<p>Okay than deffinitely some files are not in 32k. Or is it possible in fact they are but return sr != 32kHz ?  Thanks</p>",
          "rawMarkdown": "Okay than deffinitely some files are not in 32k. Or is it possible in fact they are but return sr != 32kHz ?  Thanks"
        },
        {
          "id": 1008177,
          "postDate": "2020-09-12T19:51:44.170Z",
          "content": "<p>I wish host had cleared that.  It is not that we didn't ask.</p>",
          "rawMarkdown": "I wish host had cleared that.  It is not that we didn't ask."
        }
      ]
    },
    {
      "id": 995328,
      "postDate": "2020-09-02T11:09:28.123Z",
      "content": "<p>Yes, I can certify that. Here's what I used to resample the test data:</p>\n<p><code>sig, rate = librosa.load('/path/to/audio/file.flac', sr=32000, offset=0, duration=600, mono=True, res_type='kaiser_fast')</code><br>\n <code>librosa.output.write_wav('/path/to/test/set/file.wav', sig, rate)</code></p>\n<p>So all files have the same max. duration and sample rate. But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.</p>\n<p>Note: For most bird species, a frequency range up to 12 kHz is more than enough and you could think about resampling to 24 kHz to reduce your input size.</p>",
      "rawMarkdown": "Yes, I can certify that. Here's what I used to resample the test data:\n\n`sig, rate = librosa.load('/path/to/audio/file.flac', sr=32000, offset=0, duration=600, mono=True, res_type='kaiser_fast')`\n `librosa.output.write_wav('/path/to/test/set/file.wav', sig, rate)`\n\nSo all files have the same max. duration and sample rate. But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.\n\nNote: For most bird species, a frequency range up to 12 kHz is more than enough and you could think about resampling to 24 kHz to reduce your input size.",
      "votes": 1,
      "replies": [
        {
          "id": 995398,
          "postDate": "2020-09-02T12:07:39.410Z",
          "content": "<p>What do you mean?  Test data is wav files, not mp3?</p>",
          "rawMarkdown": "What do you mean?  Test data is wav files, not mp3?",
          "votes": 2
        },
        {
          "id": 995410,
          "postDate": "2020-09-02T12:17:08.123Z",
          "content": "<p>There <a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> wrote that files are mp3: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/159173#892421\" target=\"_blank\">https://www.kaggle.com/c/birdsong-recognition/discussion/159173#892421</a>  He specifically wrote:</p>\n<blockquote>\n  <p>To be precise, ../input/birdsong-recognition/test_audio/0a997dff022e3ad9744d4e7bbf923288.mp3, but yes.</p>\n</blockquote>\n<p><a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> please check again, something does not add up.</p>",
          "rawMarkdown": "There @sohier wrote that files are mp3: https://www.kaggle.com/c/birdsong-recognition/discussion/159173#892421  He specifically wrote:\n\n> To be precise, ../input/birdsong-recognition/test_audio/0a997dff022e3ad9744d4e7bbf923288.mp3, but yes.\n\n@stefankahl please check again, something does not add up.",
          "votes": 1
        },
        {
          "id": 995413,
          "postDate": "2020-09-02T12:21:13.840Z",
          "content": "<blockquote>\n  <p>But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.</p>\n</blockquote>\n<p>Sure.  I have been releasing software long enough to know that very well ;)  I am just trying to understand why librosa says sr is not 32000 for at least one of the files. Having one of you or Kaggle staff read all test files once with librosa would clear the issue one way or another.</p>",
          "rawMarkdown": "> But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.\n\nSure.  I have been releasing software long enough to know that very well ;)  I am just trying to understand why librosa says sr is not 32000 for at least one of the files. Having one of you or Kaggle staff read all test files once with librosa would clear the issue one way or another.",
          "votes": 1
        },
        {
          "id": 995611,
          "postDate": "2020-09-02T15:57:21.773Z",
          "content": "<p>To clarify, Stefan made his initial export as .wav and I reprocessed them to .mp3 with <code>ffmpeg</code> on my end. </p>",
          "rawMarkdown": "To clarify, Stefan made his initial export as .wav and I reprocessed them to .mp3 with `ffmpeg` on my end. "
        },
        {
          "id": 995618,
          "postDate": "2020-09-02T16:03:41.830Z",
          "content": "<p>Thanks for the answer, it makes sense.  </p>\n<p>Have you checked that librosa finds the 32kHz sampling rate when reading your files?  There is a reason why overloading the sr read from file in my code changes subsequent computation.</p>\n<p>Alternatively, is ffmpeg available in Kaggle kernels?  Maybe we have to read using the same code you use to write the file?</p>",
          "rawMarkdown": "Thanks for the answer, it makes sense.  \n\nHave you checked that librosa finds the 32kHz sampling rate when reading your files?  There is a reason why overloading the sr read from file in my code changes subsequent computation.\n\nAlternatively, is ffmpeg available in Kaggle kernels?  Maybe we have to read using the same code you use to write the file?"
        },
        {
          "id": 995625,
          "postDate": "2020-09-02T16:16:17.353Z",
          "content": "<p>ffmpeg is a Linux command line tool; I don't know that it has an option for reading files. The call I used was essentially just <code>ffmpeg -i src.wav -acodec mp3  dest.mp3</code></p>",
          "rawMarkdown": "ffmpeg is a Linux command line tool; I don't know that it has an option for reading files. The call I used was essentially just `ffmpeg -i src.wav -acodec mp3  dest.mp3`",
          "votes": 1
        },
        {
          "id": 995636,
          "postDate": "2020-09-02T16:24:51.167Z",
          "content": "<p>I get it.  But we use Python, and most likely librosa.  This is why I wonder if you checked that your files could be read properly with librosa 0.8.0 which is what we have in Kaggle kernels.</p>",
          "rawMarkdown": "I get it.  But we use Python, and most likely librosa.  This is why I wonder if you checked that your files could be read properly with librosa 0.8.0 which is what we have in Kaggle kernels.",
          "votes": 1
        }
      ]
    },
    {
      "id": 995820,
      "postDate": "2020-09-02T20:08:55.520Z",
      "content": "<p>I managed to get a meaningful sub, even though the score isn't great.  I made a number of changes hence I don't know which ones are the ones solving the issue.  Two main ones I guess are:</p>\n<ul>\n<li>Resampling to 32 kHz</li>\n<li>Computing the number of 5 seconds clips by rounding len(clip) / (5 * sr) instead of taking the ceil of it.</li>\n</ul>\n<p>Sub runs in 23 minutes with effnetb1 model.  This is the good news, lots of room for ensembling.</p>",
      "rawMarkdown": "I managed to get a meaningful sub, even though the score isn't great.  I made a number of changes hence I don't know which ones are the ones solving the issue.  Two main ones I guess are:\n\n- Resampling to 32 kHz\n- Computing the number of 5 seconds clips by rounding len(clip) / (5 * sr) instead of taking the ceil of it.\n\nSub runs in 23 minutes with effnetb1 model.  This is the good news, lots of room for ensembling.",
      "votes": 2,
      "replies": [
        {
          "id": 995941,
          "postDate": "2020-09-03T01:00:08.933Z",
          "content": "<p>I was suprised that my first submission had an awful score, but then I realized all nocall submission scored 54.4. Just an indication that I had a lot of false positive and public LB is not trust-worthy anyways.</p>",
          "rawMarkdown": "I was suprised that my first submission had an awful score, but then I realized all nocall submission scored 54.4. Just an indication that I had a lot of false positive and public LB is not trust-worthy anyways.",
          "votes": 1
        },
        {
          "id": 996554,
          "postDate": "2020-09-03T11:42:23.750Z",
          "content": "<p>Private LB will be similar, and predicting no calls maybe the most challenging part of the competition.  We'll see…</p>",
          "rawMarkdown": "Private LB will be similar, and predicting no calls maybe the most challenging part of the competition.  We'll see...",
          "votes": 1
        }
      ]
    },
    {
      "id": 995028,
      "postDate": "2020-09-02T06:11:26.313Z",
      "content": "<p>How do you read an audio file? </p>\n<ol>\n<li>librosa.load(path, sr=32000) or 2. librosa.load(path)?  In the second case, it is used by <a href=\"http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/generated/librosa.core.load.html\" target=\"_blank\">default</a> sr=22050</li>\n</ol>",
      "rawMarkdown": "How do you read an audio file? \n1. librosa.load(path, sr=32000) or 2. librosa.load(path)?  In the second case, it is used by [default](http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/generated/librosa.core.load.html) sr=22050",
      "replies": [
        {
          "id": 995042,
          "postDate": "2020-09-02T06:23:13.190Z",
          "content": "<p>I read it passing <code>sr=None</code> to get the file sampling rate.</p>",
          "rawMarkdown": "I read it passing `sr=None` to get the file sampling rate."
        }
      ]
    },
    {
      "id": 995021,
      "postDate": "2020-09-02T06:07:00.973Z",
      "rawMarkdown": "",
      "votes": -6,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1008003,
      "author_name": "Oleg Yaroshevskiy",
      "author_url": "",
      "post_date": "2020-09-12T17:25:46.103000",
      "content": "<p>Before we go. <br>\nIts still not clear whether to resample or not to 32kHz. Resampling with kaiser_best takes much time. Resampling with kaiser_fast reduces both local and LB scores slightly (I've tested this). Has anyone tried to run his pipeline on raw librosa.load(…, sr=None) files? </p>",
      "votes": 3,
      "replies": [
        {
          "id": 1008010,
          "author_name": "Oleg Yaroshevskiy",
          "author_url": "",
          "post_date": "2020-09-12T17:27:26.860000",
          "content": "<p>Is it possible that sr == None and is actually 32kHz so there is redundant resampling? That's why I'm aksing</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1008036,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2020-09-12T17:59:43.887000",
          "content": "<blockquote>\n  <p>reduces both local and LB scores slightly</p>\n</blockquote>\n<p>How big of a drop do you observe ? </p>\n<p>On our side we've been using <code>librosa.load(path, sr=sr, mono=True, res_type=\"kaiser_fast\")</code> the whole time.</p>\n<p>There is this line in the <a href=\"http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/_modules/librosa/core/audio.html#load\" target=\"_blank\">code</a> of the librosa  resample function: </p>\n<pre><code>if orig_sr == target_sr:\n    return y\n</code></pre>\n<p>The performance and runtime difference clearly indicates that some samples have <code>sr != 32 kHz</code> …</p>\n<p><a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1008045,
          "author_name": "Oleg Yaroshevskiy",
          "author_url": "",
          "post_date": "2020-09-12T18:02:12.373000",
          "content": "<p>Last time I've tested it was 603 -&gt; 602. <br>\nThat's very minor but it might cost someone a position or few. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1008065,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2020-09-12T18:15:31.910000",
          "content": "<p>Thanks for sharing, hopefully this won't affect anyone …</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1008172,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-12T19:47:28.673000",
          "content": "<blockquote>\n  <p>Has anyone tried to run his pipeline on raw librosa.load(…, sr=None) files? </p>\n</blockquote>\n<p>I did and it fails.  It is why i asked many times host to check that files are correct.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1008176,
          "author_name": "Oleg Yaroshevskiy",
          "author_url": "",
          "post_date": "2020-09-12T19:50:37.887000",
          "content": "<p>Okay than deffinitely some files are not in 32k. Or is it possible in fact they are but return sr != 32kHz ?  Thanks</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1008177,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-12T19:51:44.170000",
          "content": "<p>I wish host had cleared that.  It is not that we didn't ask.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 995328,
      "author_name": "Stefan Kahl",
      "author_url": "",
      "post_date": "2020-09-02T11:09:28.123000",
      "content": "<p>Yes, I can certify that. Here's what I used to resample the test data:</p>\n<p><code>sig, rate = librosa.load('/path/to/audio/file.flac', sr=32000, offset=0, duration=600, mono=True, res_type='kaiser_fast')</code><br>\n <code>librosa.output.write_wav('/path/to/test/set/file.wav', sig, rate)</code></p>\n<p>So all files have the same max. duration and sample rate. But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.</p>\n<p>Note: For most bird species, a frequency range up to 12 kHz is more than enough and you could think about resampling to 24 kHz to reduce your input size.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 995398,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T12:07:39.410000",
          "content": "<p>What do you mean?  Test data is wav files, not mp3?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 995410,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T12:17:08.123000",
          "content": "<p>There <a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> wrote that files are mp3: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/159173#892421\" target=\"_blank\">https://www.kaggle.com/c/birdsong-recognition/discussion/159173#892421</a>  He specifically wrote:</p>\n<blockquote>\n  <p>To be precise, ../input/birdsong-recognition/test_audio/0a997dff022e3ad9744d4e7bbf923288.mp3, but yes.</p>\n</blockquote>\n<p><a href=\"https://www.kaggle.com/stefankahl\" target=\"_blank\">@stefankahl</a> please check again, something does not add up.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 995413,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T12:21:13.840000",
          "content": "<blockquote>\n  <p>But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.</p>\n</blockquote>\n<p>Sure.  I have been releasing software long enough to know that very well ;)  I am just trying to understand why librosa says sr is not 32000 for at least one of the files. Having one of you or Kaggle staff read all test files once with librosa would clear the issue one way or another.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 995611,
          "author_name": "Sohier Dane",
          "author_url": "",
          "post_date": "2020-09-02T15:57:21.773000",
          "content": "<p>To clarify, Stefan made his initial export as .wav and I reprocessed them to .mp3 with <code>ffmpeg</code> on my end. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 995618,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T16:03:41.830000",
          "content": "<p>Thanks for the answer, it makes sense.  </p>\n<p>Have you checked that librosa finds the 32kHz sampling rate when reading your files?  There is a reason why overloading the sr read from file in my code changes subsequent computation.</p>\n<p>Alternatively, is ffmpeg available in Kaggle kernels?  Maybe we have to read using the same code you use to write the file?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 995625,
          "author_name": "Sohier Dane",
          "author_url": "",
          "post_date": "2020-09-02T16:16:17.353000",
          "content": "<p>ffmpeg is a Linux command line tool; I don't know that it has an option for reading files. The call I used was essentially just <code>ffmpeg -i src.wav -acodec mp3  dest.mp3</code></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 995636,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T16:24:51.167000",
          "content": "<p>I get it.  But we use Python, and most likely librosa.  This is why I wonder if you checked that your files could be read properly with librosa 0.8.0 which is what we have in Kaggle kernels.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 995820,
      "author_name": "CPMP",
      "author_url": "",
      "post_date": "2020-09-02T20:08:55.520000",
      "content": "<p>I managed to get a meaningful sub, even though the score isn't great.  I made a number of changes hence I don't know which ones are the ones solving the issue.  Two main ones I guess are:</p>\n<ul>\n<li>Resampling to 32 kHz</li>\n<li>Computing the number of 5 seconds clips by rounding len(clip) / (5 * sr) instead of taking the ceil of it.</li>\n</ul>\n<p>Sub runs in 23 minutes with effnetb1 model.  This is the good news, lots of room for ensembling.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 995941,
          "author_name": "Quan",
          "author_url": "",
          "post_date": "2020-09-03T01:00:08.933000",
          "content": "<p>I was suprised that my first submission had an awful score, but then I realized all nocall submission scored 54.4. Just an indication that I had a lot of false positive and public LB is not trust-worthy anyways.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 996554,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-03T11:42:23.750000",
          "content": "<p>Private LB will be similar, and predicting no calls maybe the most challenging part of the competition.  We'll see…</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 995028,
      "author_name": "Pavel Orlov",
      "author_url": "",
      "post_date": "2020-09-02T06:11:26.313000",
      "content": "<p>How do you read an audio file? </p>\n<ol>\n<li>librosa.load(path, sr=32000) or 2. librosa.load(path)?  In the second case, it is used by <a href=\"http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/generated/librosa.core.load.html\" target=\"_blank\">default</a> sr=22050</li>\n</ol>",
      "votes": 0,
      "replies": [
        {
          "id": 995042,
          "author_name": "CPMP",
          "author_url": "",
          "post_date": "2020-09-02T06:23:13.190000",
          "content": "<p>I read it passing <code>sr=None</code> to get the file sampling rate.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 995021,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-09-02T06:07:00.973000",
      "content": "",
      "votes": -6,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "994817": "I am entering the game of trying to get a successful submission.  First try was a fail.  Second try succeeds with LB score 0.\n\nThe only difference between the two is that in the second one I ignore the sampling rate returned by librosa read and I used 32000.\n\nIt means that the sampling rate in the file is different from 32000 at least once.\n\nHere is the difference between my two notebooks:\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F75976%2Fe99fcf9722ac8f1fa9df3849bd74f623%2FScreenshot_2020-09-02%20infer_model_91.png?generation=1599008039968690&alt=media)\n\nCan the host certify that the test data is sampled at 32000?  \nIn this discussion @stefankahl says test data \"should be\" sampled at 32000: https://www.kaggle.com/c/birdsong-recognition/discussion/159943#893049\n\nWhat does \"should be\" mean?  Is it a wish?  Should we resample at this rate?\n\n",
    "1008003": "Before we go. \nIts still not clear whether to resample or not to 32kHz. Resampling with kaiser_best takes much time. Resampling with kaiser_fast reduces both local and LB scores slightly (I've tested this). Has anyone tried to run his pipeline on raw librosa.load(..., sr=None) files? ",
    "995328": "Yes, I can certify that. Here's what I used to resample the test data:\n\n`sig, rate = librosa.load('/path/to/audio/file.flac', sr=32000, offset=0, duration=600, mono=True, res_type='kaiser_fast')`\n `librosa.output.write_wav('/path/to/test/set/file.wav', sig, rate)`\n\nSo all files have the same max. duration and sample rate. But we are not super-human and mistakes might happen even though we tried to polish the dataset before releasing it.\n\nNote: For most bird species, a frequency range up to 12 kHz is more than enough and you could think about resampling to 24 kHz to reduce your input size.",
    "995820": "I managed to get a meaningful sub, even though the score isn't great.  I made a number of changes hence I don't know which ones are the ones solving the issue.  Two main ones I guess are:\n\n- Resampling to 32 kHz\n- Computing the number of 5 seconds clips by rounding len(clip) / (5 * sr) instead of taking the ceil of it.\n\nSub runs in 23 minutes with effnetb1 model.  This is the good news, lots of room for ensembling.",
    "995028": "How do you read an audio file? \n1. librosa.load(path, sr=32000) or 2. librosa.load(path)?  In the second case, it is used by [default](http://man.hubwiz.com/docset/LibROSA.docset/Contents/Resources/Documents/generated/librosa.core.load.html) sr=22050",
    "995021": ""
  }
}