{
  "id": 508783,
  "title": "Mel Spectrogram time out(Testing)",
  "url": "/competitions/birdclef-2024/discussion/508783",
  "author_name": "",
  "post_date": "2024-05-31T04:57:57.447990900Z",
  "votes": 2,
  "comment_count": 15,
  "views": 0,
  "content": "<p>I used Mel spectrogram to represent the 5s raw signal, but during the testing, the notebook said  'run out of time'. <br>\nAny suggestions? :)</p>",
  "messages": [
    {
      "id": "2846329",
      "postDate": "05/31/2024 04:57:57",
      "content": "<p>I used Mel spectrogram to represent the 5s raw signal, but during the testing, the notebook said  'run out of time'. <br>\nAny suggestions? :)</p>",
      "rawMarkdown": "I used Mel spectrogram to represent the 5s raw signal, but during the testing, the notebook said  'run out of time'. \nAny suggestions? :)",
      "votes": null
    },
    {
      "id": "2846451",
      "postDate": "05/31/2024 05:53:37",
      "content": "<p>You can use openvino + onnx to speedup the infer (haven't test how much), and parallel infer (like <code>concurrent.futures.ThreadPoolExecutor</code>, works for me). Also turn the batch size for infer to 48</p>",
      "rawMarkdown": "You can use openvino + onnx to speedup the infer (haven't test how much), and parallel infer (like `concurrent.futures.ThreadPoolExecutor`, works for me). Also turn the batch size for infer to 48",
      "votes": null
    },
    {
      "id": "2846501",
      "postDate": "05/31/2024 06:06:29",
      "content": "<p>I used concurrent.futures.ThreadPoolExecutor(max_workers=2) and set the batch size from 1 to 4, and the notebook said: 'ran out of memory' (BTW I used Mobilenetv2 as the backbone). Have you ever met this problem?  </p>",
      "rawMarkdown": "I used concurrent.futures.ThreadPoolExecutor(max_workers=2) and set the batch size from 1 to 4, and the notebook said: 'ran out of memory' (BTW I used Mobilenetv2 as the backbone). Have you ever met this problem?",
      "votes": null
    },
    {
      "id": "2846604",
      "postDate": "05/31/2024 06:58:31",
      "content": "<p>Do we need to install OpenVino first? Or we can directly import it.</p>",
      "rawMarkdown": "Do we need to install OpenVino first? Or we can directly import it.",
      "votes": null
    },
    {
      "id": "2846912",
      "postDate": "05/31/2024 10:46:25",
      "content": "<p>I'm using eca_nfnet_l0 as backbone and max_workers=8, batch_size=48. It works for me. I saw other people reporting this problem, but I'm not sure why.</p>",
      "rawMarkdown": "I'm using eca_nfnet_l0 as backbone and max_workers=8, batch_size=48. It works for me. I saw other people reporting this problem, but I'm not sure why.",
      "votes": null
    },
    {
      "id": "2846918",
      "postDate": "05/31/2024 10:50:02",
      "content": "<p>I created a dataset that contains pip packages so I can install onnx &amp; openvino offline while scoring. You can create your own, but here is <a href=\"https://www.kaggle.com/datasets/sakurayuyuko/onnx-openvino-py310\" target=\"_blank\">mine</a>.<br>\n<code>!pip install --no-index -f /kaggle/input/onnx-openvino-py310 openvino onnxruntime-openvino</code></p>",
      "rawMarkdown": "I created a dataset that contains pip packages so I can install onnx & openvino offline while scoring. You can create your own, but here is [mine](https://www.kaggle.com/datasets/sakurayuyuko/onnx-openvino-py310).\n`!pip install --no-index -f /kaggle/input/onnx-openvino-py310 openvino onnxruntime-openvino`",
      "votes": null
    },
    {
      "id": "2847005",
      "postDate": "05/31/2024 11:58:31",
      "content": "<p>Got it!  Thanks for the sharing, I'll try this . Although I never use this before :o</p>",
      "rawMarkdown": "Got it!  Thanks for the sharing, I'll try this . Although I never use this before :o",
      "votes": null
    },
    {
      "id": "2847113",
      "postDate": "05/31/2024 12:37:44",
      "content": "<p>I first used efficientnet_b3 from timm and I ran out of time during the test. At first, i thought the parameters might caused this problem. But now, i just found out that eca_nfnet_l0 has larger parameters. hmmmmm,  I guess the data processing is the key….</p>",
      "rawMarkdown": "I first used efficientnet_b3 from timm and I ran out of time during the test. At first, i thought the parameters might caused this problem. But now, i just found out that eca_nfnet_l0 has larger parameters. hmmmmm,  I guess the data processing is the key....",
      "votes": null
    },
    {
      "id": "2847521",
      "postDate": "05/31/2024 15:11:23",
      "content": "<p>Try to use the unlabeled soundscape for profiling?</p>",
      "rawMarkdown": "Try to use the unlabeled soundscape for profiling?",
      "votes": null
    },
    {
      "id": "2851660",
      "postDate": "06/02/2024 21:26:49",
      "content": "<p>How many models are used during the inference stage? If 5 models are used during the inference, it is likely to have a timeout issue. For me with using efficientnet_b0 as the backbone, the maximal number of models used in ensemble is 2 without any optimization and timeout issue. </p>\n<p>Would suggest just trying to include 1 model in the submission for test if not already done so for testing. If still having the timeout issue with just 1 model, probably something wrong with the data reading. </p>",
      "rawMarkdown": "How many models are used during the inference stage? If 5 models are used during the inference, it is likely to have a timeout issue. For me with using efficientnet_b0 as the backbone, the maximal number of models used in ensemble is 2 without any optimization and timeout issue. \n\nWould suggest just trying to include 1 model in the submission for test if not already done so for testing. If still having the timeout issue with just 1 model, probably something wrong with the data reading.",
      "votes": null
    },
    {
      "id": "2851663",
      "postDate": "06/02/2024 21:30:17",
      "content": "<p>I followed notebook in this <a href=\"https://www.kaggle.com/competitions/birdclef-2024/discussion/493478\" target=\"_blank\">discussion</a> to convert my model to onnx, though currently not observing much speed up from it. Searching online it says there are only certain operations in onnx that are optimized. Can try it out to see if it works for you. </p>",
      "rawMarkdown": "I followed notebook in this [discussion](https://www.kaggle.com/competitions/birdclef-2024/discussion/493478) to convert my model to onnx, though currently not observing much speed up from it. Searching online it says there are only certain operations in onnx that are optimized. Can try it out to see if it works for you.",
      "votes": null
    },
    {
      "id": "2851811",
      "postDate": "06/03/2024 01:03:40",
      "content": "<p>I only use one model (I tried to use more but then the notebook said 'time out'). I used torchaudio.transforms.Melspectrogram and then converted to (db) and normalized the signal. I just find out that this processing costs a lot of time. </p>",
      "rawMarkdown": "I only use one model (I tried to use more but then the notebook said 'time out'). I used torchaudio.transforms.Melspectrogram and then converted to (db) and normalized the signal. I just find out that this processing costs a lot of time.",
      "votes": null
    },
    {
      "id": "2851887",
      "postDate": "06/03/2024 02:05:49",
      "content": "<p>I used <code>librosa</code> for mel spectrogram generation, and the performance seems to be okay. Not sure if <code>torchaudio</code> is optimized for GPU instead of CPU. </p>",
      "rawMarkdown": "I used `librosa` for mel spectrogram generation, and the performance seems to be okay. Not sure if `torchaudio` is optimized for GPU instead of CPU.",
      "votes": null
    },
    {
      "id": "2851897",
      "postDate": "06/03/2024 02:32:21",
      "content": "<p>using onnx will result in a 2x speedup</p>",
      "rawMarkdown": "using onnx will result in a 2x speedup",
      "votes": null
    },
    {
      "id": "2851911",
      "postDate": "06/03/2024 02:51:32",
      "content": "<p>Maybe the data augmentation? I used contrastive method and applied eight augmentations. But the model performed very bad and always ran out of time. I don't think contrastive method suit this competition. </p>",
      "rawMarkdown": "Maybe the data augmentation? I used contrastive method and applied eight augmentations. But the model performed very bad and always ran out of time. I don't think contrastive method suit this competition.",
      "votes": null
    },
    {
      "id": "2852743",
      "postDate": "06/03/2024 12:38:42",
      "content": "<p>Possibly, and indeed augmentation can be time-consuming. </p>",
      "rawMarkdown": "Possibly, and indeed augmentation can be time-consuming.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2846451,
      "author_name": "sakurayuyuko",
      "author_url": "",
      "post_date": "05/31/2024 05:53:37",
      "content": "<p>You can use openvino + onnx to speedup the infer (haven't test how much), and parallel infer (like <code>concurrent.futures.ThreadPoolExecutor</code>, works for me). Also turn the batch size for infer to 48</p>",
      "votes": null,
      "replies": [
        {
          "id": 2846501,
          "author_name": "chingnengliao",
          "author_url": "",
          "post_date": "05/31/2024 06:06:29",
          "content": "<p>I used concurrent.futures.ThreadPoolExecutor(max_workers=2) and set the batch size from 1 to 4, and the notebook said: 'ran out of memory' (BTW I used Mobilenetv2 as the backbone). Have you ever met this problem?  </p>",
          "votes": null,
          "replies": [
            {
              "id": 2846912,
              "author_name": "sakurayuyuko",
              "author_url": "",
              "post_date": "05/31/2024 10:46:25",
              "content": "<p>I'm using eca_nfnet_l0 as backbone and max_workers=8, batch_size=48. It works for me. I saw other people reporting this problem, but I'm not sure why.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2847113,
                  "author_name": "chingnengliao",
                  "author_url": "",
                  "post_date": "05/31/2024 12:37:44",
                  "content": "<p>I first used efficientnet_b3 from timm and I ran out of time during the test. At first, i thought the parameters might caused this problem. But now, i just found out that eca_nfnet_l0 has larger parameters. hmmmmm,  I guess the data processing is the key….</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2847521,
                      "author_name": "sakurayuyuko",
                      "author_url": "",
                      "post_date": "05/31/2024 15:11:23",
                      "content": "<p>Try to use the unlabeled soundscape for profiling?</p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "id": 2846604,
          "author_name": "chingnengliao",
          "author_url": "",
          "post_date": "05/31/2024 06:58:31",
          "content": "<p>Do we need to install OpenVino first? Or we can directly import it.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2846918,
              "author_name": "sakurayuyuko",
              "author_url": "",
              "post_date": "05/31/2024 10:50:02",
              "content": "<p>I created a dataset that contains pip packages so I can install onnx &amp; openvino offline while scoring. You can create your own, but here is <a href=\"https://www.kaggle.com/datasets/sakurayuyuko/onnx-openvino-py310\" target=\"_blank\">mine</a>.<br>\n<code>!pip install --no-index -f /kaggle/input/onnx-openvino-py310 openvino onnxruntime-openvino</code></p>",
              "votes": null,
              "replies": [
                {
                  "id": 2847005,
                  "author_name": "chingnengliao",
                  "author_url": "",
                  "post_date": "05/31/2024 11:58:31",
                  "content": "<p>Got it!  Thanks for the sharing, I'll try this . Although I never use this before :o</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2851663,
                      "author_name": "faithk7u",
                      "author_url": "",
                      "post_date": "06/02/2024 21:30:17",
                      "content": "<p>I followed notebook in this <a href=\"https://www.kaggle.com/competitions/birdclef-2024/discussion/493478\" target=\"_blank\">discussion</a> to convert my model to onnx, though currently not observing much speed up from it. Searching online it says there are only certain operations in onnx that are optimized. Can try it out to see if it works for you. </p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2851660,
      "author_name": "faithk7u",
      "author_url": "",
      "post_date": "06/02/2024 21:26:49",
      "content": "<p>How many models are used during the inference stage? If 5 models are used during the inference, it is likely to have a timeout issue. For me with using efficientnet_b0 as the backbone, the maximal number of models used in ensemble is 2 without any optimization and timeout issue. </p>\n<p>Would suggest just trying to include 1 model in the submission for test if not already done so for testing. If still having the timeout issue with just 1 model, probably something wrong with the data reading. </p>",
      "votes": null,
      "replies": [
        {
          "id": 2851811,
          "author_name": "chingnengliao",
          "author_url": "",
          "post_date": "06/03/2024 01:03:40",
          "content": "<p>I only use one model (I tried to use more but then the notebook said 'time out'). I used torchaudio.transforms.Melspectrogram and then converted to (db) and normalized the signal. I just find out that this processing costs a lot of time. </p>",
          "votes": null,
          "replies": [
            {
              "id": 2851887,
              "author_name": "faithk7u",
              "author_url": "",
              "post_date": "06/03/2024 02:05:49",
              "content": "<p>I used <code>librosa</code> for mel spectrogram generation, and the performance seems to be okay. Not sure if <code>torchaudio</code> is optimized for GPU instead of CPU. </p>",
              "votes": null,
              "replies": [
                {
                  "id": 2851911,
                  "author_name": "chingnengliao",
                  "author_url": "",
                  "post_date": "06/03/2024 02:51:32",
                  "content": "<p>Maybe the data augmentation? I used contrastive method and applied eight augmentations. But the model performed very bad and always ran out of time. I don't think contrastive method suit this competition. </p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2852743,
                      "author_name": "faithk7u",
                      "author_url": "",
                      "post_date": "06/03/2024 12:38:42",
                      "content": "<p>Possibly, and indeed augmentation can be time-consuming. </p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2851897,
      "author_name": "befunny",
      "author_url": "",
      "post_date": "06/03/2024 02:32:21",
      "content": "<p>using onnx will result in a 2x speedup</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2846329": "I used Mel spectrogram to represent the 5s raw signal, but during the testing, the notebook said  'run out of time'. \nAny suggestions? :)",
    "2846451": "You can use openvino + onnx to speedup the infer (haven't test how much), and parallel infer (like `concurrent.futures.ThreadPoolExecutor`, works for me). Also turn the batch size for infer to 48",
    "2846501": "I used concurrent.futures.ThreadPoolExecutor(max_workers=2) and set the batch size from 1 to 4, and the notebook said: 'ran out of memory' (BTW I used Mobilenetv2 as the backbone). Have you ever met this problem?",
    "2846604": "Do we need to install OpenVino first? Or we can directly import it.",
    "2846912": "I'm using eca_nfnet_l0 as backbone and max_workers=8, batch_size=48. It works for me. I saw other people reporting this problem, but I'm not sure why.",
    "2846918": "I created a dataset that contains pip packages so I can install onnx & openvino offline while scoring. You can create your own, but here is [mine](https://www.kaggle.com/datasets/sakurayuyuko/onnx-openvino-py310).\n`!pip install --no-index -f /kaggle/input/onnx-openvino-py310 openvino onnxruntime-openvino`",
    "2847005": "Got it!  Thanks for the sharing, I'll try this . Although I never use this before :o",
    "2847113": "I first used efficientnet_b3 from timm and I ran out of time during the test. At first, i thought the parameters might caused this problem. But now, i just found out that eca_nfnet_l0 has larger parameters. hmmmmm,  I guess the data processing is the key....",
    "2847521": "Try to use the unlabeled soundscape for profiling?",
    "2851660": "How many models are used during the inference stage? If 5 models are used during the inference, it is likely to have a timeout issue. For me with using efficientnet_b0 as the backbone, the maximal number of models used in ensemble is 2 without any optimization and timeout issue. \n\nWould suggest just trying to include 1 model in the submission for test if not already done so for testing. If still having the timeout issue with just 1 model, probably something wrong with the data reading.",
    "2851663": "I followed notebook in this [discussion](https://www.kaggle.com/competitions/birdclef-2024/discussion/493478) to convert my model to onnx, though currently not observing much speed up from it. Searching online it says there are only certain operations in onnx that are optimized. Can try it out to see if it works for you.",
    "2851811": "I only use one model (I tried to use more but then the notebook said 'time out'). I used torchaudio.transforms.Melspectrogram and then converted to (db) and normalized the signal. I just find out that this processing costs a lot of time.",
    "2851887": "I used `librosa` for mel spectrogram generation, and the performance seems to be okay. Not sure if `torchaudio` is optimized for GPU instead of CPU.",
    "2851897": "using onnx will result in a 2x speedup",
    "2851911": "Maybe the data augmentation? I used contrastive method and applied eight augmentations. But the model performed very bad and always ran out of time. I don't think contrastive method suit this competition.",
    "2852743": "Possibly, and indeed augmentation can be time-consuming."
  },
  "source": "meta"
}