{
  "id": 172042,
  "title": "Be Aware of Your Model's Inference Time",
  "url": "/competitions/birdsong-recognition/discussion/172042",
  "author_name": "",
  "post_date": "2020-08-03T13:02:15.723563800Z",
  "votes": 10,
  "comment_count": 11,
  "views": 0,
  "content": "<p>The competition rule states:\n&gt; This is a Code Competition\nSubmissions to this competition must be made through Notebooks. In order for the \"Submit to Competition\" button to be active after a commit, the following conditions must be met:\nCPU Notebook &lt;= 9 hours run-time\nGPU Notebook &lt;= 2 hours run-time</p>\n\n<p>[Hypothesis]:\nIf your notebook times out, it will still say the submission \"succeeded\", the remaining rows would default to \"nocall.\" You might actually have a good model, it might just be too slow.</p>\n\n<p><a href=\"/snovik1975\">@snovik1975</a> pointed this out in this thread: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/163528\">https://www.kaggle.com/c/birdsong-recognition/discussion/163528</a></p>\n\n<p>[Observation 1]: \nMy efficientnet model kept scoring model kept scoring ~0.557 on public LB despite scoring ~ 0.67 micro F1 on stratified k-fold holdout set. After I made some tweaks speeding up prediction loop, the same model jumped to my current LB score of ~0.568.</p>\n\n<p>[Observation 2]: \nThe correlation coefficient between my 0.568 efficientnet and the 0.568 ResNest public notebook is ~0.76, this \"should\" be diverse enough that averaging the two models would improve score, which is the case on local validation. Surprise surprise (not really at this point), the ensemble scores 0.559 public LB. I think what is happening is that the ensemble is now too slow, the notebook times out and the remaining rows default to \"nocall.\"</p>\n\n<p>If you're model is stuck at ~0.55x, despite improved local CV score, check and make sure it's actually able to infer labels on all 150 files within the allocated 2 GPU hours or 9 CPU hours. You might actually have a good model, the inference routing might just be too slow.</p>\n\n<p>Good luck all! </p>",
  "messages": [
    {
      "id": "956380",
      "postDate": "08/03/2020 13:02:15",
      "content": "<p>The competition rule states:\n&gt; This is a Code Competition\nSubmissions to this competition must be made through Notebooks. In order for the \"Submit to Competition\" button to be active after a commit, the following conditions must be met:\nCPU Notebook &lt;= 9 hours run-time\nGPU Notebook &lt;= 2 hours run-time</p>\n\n<p>[Hypothesis]:\nIf your notebook times out, it will still say the submission \"succeeded\", the remaining rows would default to \"nocall.\" You might actually have a good model, it might just be too slow.</p>\n\n<p><a href=\"/snovik1975\">@snovik1975</a> pointed this out in this thread: <a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/163528\">https://www.kaggle.com/c/birdsong-recognition/discussion/163528</a></p>\n\n<p>[Observation 1]: \nMy efficientnet model kept scoring model kept scoring ~0.557 on public LB despite scoring ~ 0.67 micro F1 on stratified k-fold holdout set. After I made some tweaks speeding up prediction loop, the same model jumped to my current LB score of ~0.568.</p>\n\n<p>[Observation 2]: \nThe correlation coefficient between my 0.568 efficientnet and the 0.568 ResNest public notebook is ~0.76, this \"should\" be diverse enough that averaging the two models would improve score, which is the case on local validation. Surprise surprise (not really at this point), the ensemble scores 0.559 public LB. I think what is happening is that the ensemble is now too slow, the notebook times out and the remaining rows default to \"nocall.\"</p>\n\n<p>If you're model is stuck at ~0.55x, despite improved local CV score, check and make sure it's actually able to infer labels on all 150 files within the allocated 2 GPU hours or 9 CPU hours. You might actually have a good model, the inference routing might just be too slow.</p>\n\n<p>Good luck all! </p>",
      "rawMarkdown": "The competition rule states:\n&gt; This is a Code Competition\nSubmissions to this competition must be made through Notebooks. In order for the \"Submit to Competition\" button to be active after a commit, the following conditions must be met:\nCPU Notebook &lt;= 9 hours run-time\nGPU Notebook &lt;= 2 hours run-time\n\n[Hypothesis]:\nIf your notebook times out, it will still say the submission \"succeeded\", the remaining rows would default to \"nocall.\" You might actually have a good model, it might just be too slow.\n\n @snovik1975 pointed this out in this thread: https://www.kaggle.com/c/birdsong-recognition/discussion/163528\n\n[Observation 1]: \nMy efficientnet model kept scoring model kept scoring ~0.557 on public LB despite scoring ~ 0.67 micro F1 on stratified k-fold holdout set. After I made some tweaks speeding up prediction loop, the same model jumped to my current LB score of ~0.568.\n\n[Observation 2]: \nThe correlation coefficient between my 0.568 efficientnet and the 0.568 ResNest public notebook is ~0.76, this \"should\" be diverse enough that averaging the two models would improve score, which is the case on local validation. Surprise surprise (not really at this point), the ensemble scores 0.559 public LB. I think what is happening is that the ensemble is now too slow, the notebook times out and the remaining rows default to \"nocall.\"\n\nIf you're model is stuck at ~0.55x, despite improved local CV score, check and make sure it's actually able to infer labels on all 150 files within the allocated 2 GPU hours or 9 CPU hours. You might actually have a good model, the inference routing might just be too slow.\n\nGood luck all!",
      "votes": null
    },
    {
      "id": "956445",
      "postDate": "08/03/2020 14:04:08",
      "content": "<p>No. If the model does not have enough time, it will be labeled Notebook Timeout.\nAnd you can always see how many minutes the result will appear. </p>",
      "rawMarkdown": "No. If the model does not have enough time, it will be labeled Notebook Timeout.\nAnd you can always see how many minutes the result will appear.",
      "votes": null
    },
    {
      "id": "956457",
      "postDate": "08/03/2020 14:20:00",
      "content": "<p>Actually mine all says \"succeeded,\" even the ones that clearly failed.</p>\n\n<p>Here's a fresh example, there was an error that caused the versions 1 and 3 to fail, it still says \"succeeded,\" once I fixed the error on version 4, then it score 0.568:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F36054%2Feb3b16d1d1655c3fa3701077051cfae1%2Fsubmissions.jpg?generation=1596464010455873&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Actually mine all says \"succeeded,\" even the ones that clearly failed.\n\nHere's a fresh example, there was an error that caused the versions 1 and 3 to fail, it still says \"succeeded,\" once I fixed the error on version 4, then it score 0.568:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F36054%2Feb3b16d1d1655c3fa3701077051cfae1%2Fsubmissions.jpg?generation=1596464010455873&amp;alt=media)",
      "votes": null
    },
    {
      "id": "956468",
      "postDate": "08/03/2020 14:27:24",
      "content": "<p>Note how many minutes later the rating appears, I have it for 32 minutes\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3577701%2F363a68ef194976db9a7576a6e46c0bdd%2F2020-08-03.png?generation=1596464754086486&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Note how many minutes later the rating appears, I have it for 32 minutes\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3577701%2F363a68ef194976db9a7576a6e46c0bdd%2F2020-08-03.png?generation=1596464754086486&amp;alt=media)",
      "votes": null
    },
    {
      "id": "956492",
      "postDate": "08/03/2020 14:41:10",
      "content": "<p>How do you check how long the notebook ran to create the submission?</p>",
      "rawMarkdown": "How do you check how long the notebook ran to create the submission?",
      "votes": null
    },
    {
      "id": "956498",
      "postDate": "08/03/2020 14:46:03",
      "content": "<p>Just watch how long after sending the solution the result will appear</p>",
      "rawMarkdown": "Just watch how long after sending the solution the result will appear",
      "votes": null
    },
    {
      "id": "956517",
      "postDate": "08/03/2020 15:15:53",
      "content": "<p>Alright will time my next submission. Although, I'm fairly sure I've had submissions take more 2 hours. :)</p>\n\n<p>It would be nice to receive information how long a it took to submit a notebook.</p>",
      "rawMarkdown": "Alright will time my next submission. Although, I'm fairly sure I've had submissions take more 2 hours. :)\n\nIt would be nice to receive information how long a it took to submit a notebook.",
      "votes": null
    },
    {
      "id": "956716",
      "postDate": "08/03/2020 18:00:15",
      "content": "<p>Kernel will report timeout and not succeeded. My 2 first attempts exceeded the 2 hours due to librosa.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F698363%2F0a1a15e6a9846415633a66a58aa48eac%2Ftimeout.png?generation=1596477592282086&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Kernel will report timeout and not succeeded. My 2 first attempts exceeded the 2 hours due to librosa.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F698363%2F0a1a15e6a9846415633a66a58aa48eac%2Ftimeout.png?generation=1596477592282086&amp;alt=media)",
      "votes": null
    },
    {
      "id": "956725",
      "postDate": "08/03/2020 18:17:25",
      "content": "<p>Good to know! Thanks for sharing.</p>",
      "rawMarkdown": "Good to know! Thanks for sharing.",
      "votes": null
    },
    {
      "id": "957830",
      "postDate": "08/04/2020 15:26:22",
      "content": "<p>Thanks for sharing Mendrika. Can you tell us what kind of error you had (and fixed) on you notebook? </p>",
      "rawMarkdown": "Thanks for sharing Mendrika. Can you tell us what kind of error you had (and fixed) on you notebook?",
      "votes": null
    },
    {
      "id": "992020",
      "postDate": "08/30/2020 20:15:05",
      "content": "<blockquote>\n  <p>My 2 first attempts exceeded the 2 hours due to librosa.</p>\n</blockquote>\n<p>Why is librosa the cause of the timeout?</p>",
      "rawMarkdown": ">  My 2 first attempts exceeded the 2 hours due to librosa.\n\nWhy is librosa the cause of the timeout?",
      "votes": null
    },
    {
      "id": "992057",
      "postDate": "08/30/2020 21:36:06",
      "content": "<p>I'm not 100% sure but it could come from an issue in resolving the final underlying library for MP3 support. There is a warning before fallback to another library that works. It seems to take time on Kaggle platform.<br>\n<a href=\"https://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files\" target=\"_blank\">https://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files</a><br>\nI'm using torchaudio and it's around 2x to 3x faster to load the same MP3.</p>",
      "rawMarkdown": "I'm not 100% sure but it could come from an issue in resolving the final underlying library for MP3 support. There is a warning before fallback to another library that works. It seems to take time on Kaggle platform.\nhttps://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files\nI'm using torchaudio and it's around 2x to 3x faster to load the same MP3.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 956445,
      "author_name": "vlomme",
      "author_url": "",
      "post_date": "08/03/2020 14:04:08",
      "content": "<p>No. If the model does not have enough time, it will be labeled Notebook Timeout.\nAnd you can always see how many minutes the result will appear. </p>",
      "votes": null,
      "replies": [
        {
          "id": 956457,
          "author_name": "ramarlina",
          "author_url": "",
          "post_date": "08/03/2020 14:20:00",
          "content": "<p>Actually mine all says \"succeeded,\" even the ones that clearly failed.</p>\n\n<p>Here's a fresh example, there was an error that caused the versions 1 and 3 to fail, it still says \"succeeded,\" once I fixed the error on version 4, then it score 0.568:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F36054%2Feb3b16d1d1655c3fa3701077051cfae1%2Fsubmissions.jpg?generation=1596464010455873&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 956468,
          "author_name": "vlomme",
          "author_url": "",
          "post_date": "08/03/2020 14:27:24",
          "content": "<p>Note how many minutes later the rating appears, I have it for 32 minutes\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3577701%2F363a68ef194976db9a7576a6e46c0bdd%2F2020-08-03.png?generation=1596464754086486&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 956492,
          "author_name": "ramarlina",
          "author_url": "",
          "post_date": "08/03/2020 14:41:10",
          "content": "<p>How do you check how long the notebook ran to create the submission?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 956498,
          "author_name": "vlomme",
          "author_url": "",
          "post_date": "08/03/2020 14:46:03",
          "content": "<p>Just watch how long after sending the solution the result will appear</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 956517,
          "author_name": "ramarlina",
          "author_url": "",
          "post_date": "08/03/2020 15:15:53",
          "content": "<p>Alright will time my next submission. Although, I'm fairly sure I've had submissions take more 2 hours. :)</p>\n\n<p>It would be nice to receive information how long a it took to submit a notebook.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 957830,
          "author_name": "adriel",
          "author_url": "",
          "post_date": "08/04/2020 15:26:22",
          "content": "<p>Thanks for sharing Mendrika. Can you tell us what kind of error you had (and fixed) on you notebook? </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 956716,
      "author_name": "mpware",
      "author_url": "",
      "post_date": "08/03/2020 18:00:15",
      "content": "<p>Kernel will report timeout and not succeeded. My 2 first attempts exceeded the 2 hours due to librosa.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F698363%2F0a1a15e6a9846415633a66a58aa48eac%2Ftimeout.png?generation=1596477592282086&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 956725,
          "author_name": "ramarlina",
          "author_url": "",
          "post_date": "08/03/2020 18:17:25",
          "content": "<p>Good to know! Thanks for sharing.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 992020,
          "author_name": "cpmpml",
          "author_url": "",
          "post_date": "08/30/2020 20:15:05",
          "content": "<blockquote>\n  <p>My 2 first attempts exceeded the 2 hours due to librosa.</p>\n</blockquote>\n<p>Why is librosa the cause of the timeout?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 992057,
          "author_name": "mpware",
          "author_url": "",
          "post_date": "08/30/2020 21:36:06",
          "content": "<p>I'm not 100% sure but it could come from an issue in resolving the final underlying library for MP3 support. There is a warning before fallback to another library that works. It seems to take time on Kaggle platform.<br>\n<a href=\"https://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files\" target=\"_blank\">https://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files</a><br>\nI'm using torchaudio and it's around 2x to 3x faster to load the same MP3.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "956380": "The competition rule states:\n&gt; This is a Code Competition\nSubmissions to this competition must be made through Notebooks. In order for the \"Submit to Competition\" button to be active after a commit, the following conditions must be met:\nCPU Notebook &lt;= 9 hours run-time\nGPU Notebook &lt;= 2 hours run-time\n\n[Hypothesis]:\nIf your notebook times out, it will still say the submission \"succeeded\", the remaining rows would default to \"nocall.\" You might actually have a good model, it might just be too slow.\n\n @snovik1975 pointed this out in this thread: https://www.kaggle.com/c/birdsong-recognition/discussion/163528\n\n[Observation 1]: \nMy efficientnet model kept scoring model kept scoring ~0.557 on public LB despite scoring ~ 0.67 micro F1 on stratified k-fold holdout set. After I made some tweaks speeding up prediction loop, the same model jumped to my current LB score of ~0.568.\n\n[Observation 2]: \nThe correlation coefficient between my 0.568 efficientnet and the 0.568 ResNest public notebook is ~0.76, this \"should\" be diverse enough that averaging the two models would improve score, which is the case on local validation. Surprise surprise (not really at this point), the ensemble scores 0.559 public LB. I think what is happening is that the ensemble is now too slow, the notebook times out and the remaining rows default to \"nocall.\"\n\nIf you're model is stuck at ~0.55x, despite improved local CV score, check and make sure it's actually able to infer labels on all 150 files within the allocated 2 GPU hours or 9 CPU hours. You might actually have a good model, the inference routing might just be too slow.\n\nGood luck all!",
    "956445": "No. If the model does not have enough time, it will be labeled Notebook Timeout.\nAnd you can always see how many minutes the result will appear.",
    "956457": "Actually mine all says \"succeeded,\" even the ones that clearly failed.\n\nHere's a fresh example, there was an error that caused the versions 1 and 3 to fail, it still says \"succeeded,\" once I fixed the error on version 4, then it score 0.568:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F36054%2Feb3b16d1d1655c3fa3701077051cfae1%2Fsubmissions.jpg?generation=1596464010455873&amp;alt=media)",
    "956468": "Note how many minutes later the rating appears, I have it for 32 minutes\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3577701%2F363a68ef194976db9a7576a6e46c0bdd%2F2020-08-03.png?generation=1596464754086486&amp;alt=media)",
    "956492": "How do you check how long the notebook ran to create the submission?",
    "956498": "Just watch how long after sending the solution the result will appear",
    "956517": "Alright will time my next submission. Although, I'm fairly sure I've had submissions take more 2 hours. :)\n\nIt would be nice to receive information how long a it took to submit a notebook.",
    "956716": "Kernel will report timeout and not succeeded. My 2 first attempts exceeded the 2 hours due to librosa.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F698363%2F0a1a15e6a9846415633a66a58aa48eac%2Ftimeout.png?generation=1596477592282086&amp;alt=media)",
    "956725": "Good to know! Thanks for sharing.",
    "957830": "Thanks for sharing Mendrika. Can you tell us what kind of error you had (and fixed) on you notebook?",
    "992020": ">  My 2 first attempts exceeded the 2 hours due to librosa.\n\nWhy is librosa the cause of the timeout?",
    "992057": "I'm not 100% sure but it could come from an issue in resolving the final underlying library for MP3 support. There is a warning before fallback to another library that works. It seems to take time on Kaggle platform.\nhttps://stackoverflow.com/questions/59854527/librosa-load-takes-too-long-to-loadsample-mp3-files\nI'm using torchaudio and it's around 2x to 3x faster to load the same MP3."
  },
  "source": "meta"
}