{
  "id": 316421,
  "title": "Is the submitting offline or online?",
  "url": "/competitions/birdclef-2022/discussion/316421",
  "author_name": "",
  "post_date": "2022-04-01T20:32:31.477331900Z",
  "votes": 4,
  "comment_count": 11,
  "views": 0,
  "content": "<p>I tried to submit my model but every time I submit I get an error without details although  I do the submission correctly, so does the submitting need strong internet because I have a week internet???</p>",
  "messages": [
    {
      "id": "1742396",
      "postDate": "04/01/2022 20:32:31",
      "content": "<p>I tried to submit my model but every time I submit I get an error without details although  I do the submission correctly, so does the submitting need strong internet because I have a week internet???</p>",
      "rawMarkdown": "I tried to submit my model but every time I submit I get an error without details although  I do the submission correctly, so does the submitting need strong internet because I have a week internet???",
      "votes": null
    },
    {
      "id": "1742417",
      "postDate": "04/01/2022 21:01:43",
      "content": "<p>I don’t think the internet is causing the problem. Can you share a screenshot and other details?</p>",
      "rawMarkdown": "I don’t think the internet is causing the problem. Can you share a screenshot and other details?",
      "votes": null
    },
    {
      "id": "1742434",
      "postDate": "04/01/2022 21:27:21",
      "content": "<p>i thought that the problem from the internet because the electrecity is not good in my country so the internet will cut regularly every 4 hours. (there is an error when i try to upload an image). </p>",
      "rawMarkdown": "i thought that the problem from the internet because the electrecity is not good in my country so the internet will cut regularly every 4 hours. (there is an error when i try to upload an image).",
      "votes": null
    },
    {
      "id": "1742435",
      "postDate": "04/01/2022 21:29:23",
      "content": "<p>anyway, how much time does it takes to make a submission?</p>",
      "rawMarkdown": "anyway, how much time does it takes to make a submission?",
      "votes": null
    },
    {
      "id": "1742437",
      "postDate": "04/01/2022 21:34:26",
      "content": "<p>`for afile in file_list:<br>\n    # read files<br>\n    path = test_audio_dir + afile + '.ogg'<br>\n    audio, sr = librosa.load(path)<br>\n    #audio = _resample_if_necessary(audio, sr)<br>\n    #audio = _mix_down_if_necessary(audio)</p>\n<pre><code># chunk audio to 5sec\nchunks = []\nfor i in range(0, len(audio), total_length):\n    sig = audio[i:i + total_length]\n    length_signal = sig.shape[0]\n    num_missing_samples = total_length - length_signal\n    sig = np.concatenate([sig, [0] * num_missing_samples])\n\n    mel = librosa.feature.melspectrogram(sig, n_fft=800, hop_length=520, sr=target_sample_rate, fmin=20,fmax=14_000, n_mels=64)  # n_mels=1024\n    mel = librosa.amplitude_to_db(mel, top_db=100.)\n\n    mel = np.array(normalize(torch.tensor(mel).unsqueeze(0)))\n    mel = np.array(cv2.resize(mel.squeeze(), (64, 64))).reshape((1, 64, 64))\n    chunks.append(torch.tensor(mel,dtype=torch.float))\n\n\ntest = torch.stack(chunks).to(device)\n\nfor i in range(len(chunks)):        \n    chunk_end_time = (i + 1) * 5\n    for bird in scored_birds:\n        outputs = best_model(test[i].unsqueeze(0)).detach().cpu().numpy().argmax(1)\n        target2index = class_labels[outputs[0]]\n        try:\n            bird = test_df.loc[i, \"bird\"]\n            target = bird == target2index \n            row_id = afile + '_' + 'skylar' + '_' + str(chunk_end_time)\n            pred['row_id'].append(row_id)\n            pred['target'].append('skylar')\n        except:\n            continue`\n</code></pre>",
      "rawMarkdown": "`for afile in file_list:\n    # read files\n    path = test_audio_dir + afile + '.ogg'\n    audio, sr = librosa.load(path)\n    #audio = _resample_if_necessary(audio, sr)\n    #audio = _mix_down_if_necessary(audio)\n    \n    # chunk audio to 5sec\n    chunks = []\n    for i in range(0, len(audio), total_length):\n        sig = audio[i:i + total_length]\n        length_signal = sig.shape[0]\n        num_missing_samples = total_length - length_signal\n        sig = np.concatenate([sig, [0] * num_missing_samples])\n        \n        mel = librosa.feature.melspectrogram(sig, n_fft=800, hop_length=520, sr=target_sample_rate, fmin=20,fmax=14_000, n_mels=64)  # n_mels=1024\n        mel = librosa.amplitude_to_db(mel, top_db=100.)\n\n        mel = np.array(normalize(torch.tensor(mel).unsqueeze(0)))\n        mel = np.array(cv2.resize(mel.squeeze(), (64, 64))).reshape((1, 64, 64))\n        chunks.append(torch.tensor(mel,dtype=torch.float))\n            \n\n    test = torch.stack(chunks).to(device)\n        \n    for i in range(len(chunks)):        \n        chunk_end_time = (i + 1) * 5\n        for bird in scored_birds:\n            outputs = best_model(test[i].unsqueeze(0)).detach().cpu().numpy().argmax(1)\n            target2index = class_labels[outputs[0]]\n            try:\n                bird = test_df.loc[i, \"bird\"]\n                target = bird == target2index \n                row_id = afile + '_' + 'skylar' + '_' + str(chunk_end_time)\n                pred['row_id'].append(row_id)\n                pred['target'].append('skylar')\n            except:\n                continue`",
      "votes": null
    },
    {
      "id": "1742441",
      "postDate": "04/01/2022 21:46:44",
      "content": "<p>If you work in the kaggle kernel, it automatically saves things during the session. The save version option runs and saves the notebook. No internet connection is required for the latter. How long it runs depends on your code. It will stop in error after 9 hours because that is the limit.</p>",
      "rawMarkdown": "If you work in the kaggle kernel, it automatically saves things during the session. The save version option runs and saves the notebook. No internet connection is required for the latter. How long it runs depends on your code. It will stop in error after 9 hours because that is the limit.",
      "votes": null
    },
    {
      "id": "1742832",
      "postDate": "04/02/2022 10:24:30",
      "content": "<pre><code>for i in range(12):\n            chunk_end_time = (i + 1) * 5\n            for bird in scored_birds:\n                try:\n                    score = outputs_test[i][np.where(bird_label == bird)]\n                except IndexError:\n                    score = 0\n\n                row_id = file + '_' + bird + '_' + str(chunk_end_time)\n\n                pred['row_id'].append(row_id)\n                pred['target'].append(True if score &gt; threshold else False)\n</code></pre>\n<h1>I got the same error,  and you can replace \"len(chunks)\" by \"12\"</h1>",
      "rawMarkdown": "```\nfor i in range(12):\n            chunk_end_time = (i + 1) * 5\n            for bird in scored_birds:\n                try:\n                    score = outputs_test[i][np.where(bird_label == bird)]\n                except IndexError:\n                    score = 0\n\n                row_id = file + '_' + bird + '_' + str(chunk_end_time)\n\n                pred['row_id'].append(row_id)\n                pred['target'].append(True if score > threshold else False)\n```\n\n# I got the same error,  and you can replace \"len(chunks)\" by \"12\"",
      "votes": null
    },
    {
      "id": "1743329",
      "postDate": "04/02/2022 21:46:18",
      "content": "<p>BokingChen i will try it</p>",
      "rawMarkdown": "BokingChen i will try it",
      "votes": null
    },
    {
      "id": "1743733",
      "postDate": "04/03/2022 09:03:53",
      "content": "<p>when I run my notebook the way BokingChen sayed, i get this input:</p>\n<pre><code>0      soundscape_453028782_akiapo_5   False\n1      soundscape_453028782_aniani_5   False\n2      soundscape_453028782_apapan_5   False\n3      soundscape_453028782_barpet_5   False\n4      soundscape_453028782_crehon_5   False\n..                               ...     ...\n247     soundscape_453028782_omao_60   False\n248   soundscape_453028782_puaioh_60   False\n249   soundscape_453028782_skylar_60   False\n250  soundscape_453028782_warwhe1_60   False\n251   soundscape_453028782_yefcan_60   False\n</code></pre>\n<p>the whole sound will be applied to all the birds. Is this correct or should I modify</p>",
      "rawMarkdown": "when I run my notebook the way BokingChen sayed, i get this input:\n```\n0      soundscape_453028782_akiapo_5   False\n1      soundscape_453028782_aniani_5   False\n2      soundscape_453028782_apapan_5   False\n3      soundscape_453028782_barpet_5   False\n4      soundscape_453028782_crehon_5   False\n..                               ...     ...\n247     soundscape_453028782_omao_60   False\n248   soundscape_453028782_puaioh_60   False\n249   soundscape_453028782_skylar_60   False\n250  soundscape_453028782_warwhe1_60   False\n251   soundscape_453028782_yefcan_60   False\n```\nthe whole sound will be applied to all the birds. Is this correct or should I modify",
      "votes": null
    },
    {
      "id": "1745005",
      "postDate": "04/04/2022 13:57:52",
      "content": "<p>BokingChen thanks it worked 👍</p>",
      "rawMarkdown": "BokingChen thanks it worked 👍",
      "votes": null
    },
    {
      "id": "1757958",
      "postDate": "04/17/2022 07:05:46",
      "content": "<p>I don't think Internet power has a relationship to the submission result because the kernel is executed by Kaggle server.<br>\nYou can get information about error and debugging tips on this page.<br>\n<a href=\"https://www.kaggle.com/code-competition-debugging\" target=\"_blank\">https://www.kaggle.com/code-competition-debugging</a></p>",
      "rawMarkdown": "I don't think Internet power has a relationship to the submission result because the kernel is executed by Kaggle server.\nYou can get information about error and debugging tips on this page.\nhttps://www.kaggle.com/code-competition-debugging",
      "votes": null
    },
    {
      "id": "1758425",
      "postDate": "04/17/2022 17:07:44",
      "content": "<p>I solved the problem, it was from my code. but I thought  the internet is a broblem because in my country I have problem with the internet</p>",
      "rawMarkdown": "I solved the problem, it was from my code. but I thought  the internet is a broblem because in my country I have problem with the internet",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1742417,
      "author_name": "ambrusattila",
      "author_url": "",
      "post_date": "04/01/2022 21:01:43",
      "content": "<p>I don’t think the internet is causing the problem. Can you share a screenshot and other details?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1742434,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/01/2022 21:27:21",
      "content": "<p>i thought that the problem from the internet because the electrecity is not good in my country so the internet will cut regularly every 4 hours. (there is an error when i try to upload an image). </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1742435,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/01/2022 21:29:23",
      "content": "<p>anyway, how much time does it takes to make a submission?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1742441,
          "author_name": "ambrusattila",
          "author_url": "",
          "post_date": "04/01/2022 21:46:44",
          "content": "<p>If you work in the kaggle kernel, it automatically saves things during the session. The save version option runs and saves the notebook. No internet connection is required for the latter. How long it runs depends on your code. It will stop in error after 9 hours because that is the limit.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1742437,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/01/2022 21:34:26",
      "content": "<p>`for afile in file_list:<br>\n    # read files<br>\n    path = test_audio_dir + afile + '.ogg'<br>\n    audio, sr = librosa.load(path)<br>\n    #audio = _resample_if_necessary(audio, sr)<br>\n    #audio = _mix_down_if_necessary(audio)</p>\n<pre><code># chunk audio to 5sec\nchunks = []\nfor i in range(0, len(audio), total_length):\n    sig = audio[i:i + total_length]\n    length_signal = sig.shape[0]\n    num_missing_samples = total_length - length_signal\n    sig = np.concatenate([sig, [0] * num_missing_samples])\n\n    mel = librosa.feature.melspectrogram(sig, n_fft=800, hop_length=520, sr=target_sample_rate, fmin=20,fmax=14_000, n_mels=64)  # n_mels=1024\n    mel = librosa.amplitude_to_db(mel, top_db=100.)\n\n    mel = np.array(normalize(torch.tensor(mel).unsqueeze(0)))\n    mel = np.array(cv2.resize(mel.squeeze(), (64, 64))).reshape((1, 64, 64))\n    chunks.append(torch.tensor(mel,dtype=torch.float))\n\n\ntest = torch.stack(chunks).to(device)\n\nfor i in range(len(chunks)):        \n    chunk_end_time = (i + 1) * 5\n    for bird in scored_birds:\n        outputs = best_model(test[i].unsqueeze(0)).detach().cpu().numpy().argmax(1)\n        target2index = class_labels[outputs[0]]\n        try:\n            bird = test_df.loc[i, \"bird\"]\n            target = bird == target2index \n            row_id = afile + '_' + 'skylar' + '_' + str(chunk_end_time)\n            pred['row_id'].append(row_id)\n            pred['target'].append('skylar')\n        except:\n            continue`\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1742832,
      "author_name": "chenbaoying",
      "author_url": "",
      "post_date": "04/02/2022 10:24:30",
      "content": "<pre><code>for i in range(12):\n            chunk_end_time = (i + 1) * 5\n            for bird in scored_birds:\n                try:\n                    score = outputs_test[i][np.where(bird_label == bird)]\n                except IndexError:\n                    score = 0\n\n                row_id = file + '_' + bird + '_' + str(chunk_end_time)\n\n                pred['row_id'].append(row_id)\n                pred['target'].append(True if score &gt; threshold else False)\n</code></pre>\n<h1>I got the same error,  and you can replace \"len(chunks)\" by \"12\"</h1>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1743329,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/02/2022 21:46:18",
      "content": "<p>BokingChen i will try it</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1743733,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/03/2022 09:03:53",
      "content": "<p>when I run my notebook the way BokingChen sayed, i get this input:</p>\n<pre><code>0      soundscape_453028782_akiapo_5   False\n1      soundscape_453028782_aniani_5   False\n2      soundscape_453028782_apapan_5   False\n3      soundscape_453028782_barpet_5   False\n4      soundscape_453028782_crehon_5   False\n..                               ...     ...\n247     soundscape_453028782_omao_60   False\n248   soundscape_453028782_puaioh_60   False\n249   soundscape_453028782_skylar_60   False\n250  soundscape_453028782_warwhe1_60   False\n251   soundscape_453028782_yefcan_60   False\n</code></pre>\n<p>the whole sound will be applied to all the birds. Is this correct or should I modify</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1745005,
      "author_name": "xv7d111",
      "author_url": "",
      "post_date": "04/04/2022 13:57:52",
      "content": "<p>BokingChen thanks it worked 👍</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1757958,
      "author_name": "kotanoda",
      "author_url": "",
      "post_date": "04/17/2022 07:05:46",
      "content": "<p>I don't think Internet power has a relationship to the submission result because the kernel is executed by Kaggle server.<br>\nYou can get information about error and debugging tips on this page.<br>\n<a href=\"https://www.kaggle.com/code-competition-debugging\" target=\"_blank\">https://www.kaggle.com/code-competition-debugging</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1758425,
          "author_name": "xv7d111",
          "author_url": "",
          "post_date": "04/17/2022 17:07:44",
          "content": "<p>I solved the problem, it was from my code. but I thought  the internet is a broblem because in my country I have problem with the internet</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1742396": "I tried to submit my model but every time I submit I get an error without details although  I do the submission correctly, so does the submitting need strong internet because I have a week internet???",
    "1742417": "I don’t think the internet is causing the problem. Can you share a screenshot and other details?",
    "1742434": "i thought that the problem from the internet because the electrecity is not good in my country so the internet will cut regularly every 4 hours. (there is an error when i try to upload an image).",
    "1742435": "anyway, how much time does it takes to make a submission?",
    "1742437": "`for afile in file_list:\n    # read files\n    path = test_audio_dir + afile + '.ogg'\n    audio, sr = librosa.load(path)\n    #audio = _resample_if_necessary(audio, sr)\n    #audio = _mix_down_if_necessary(audio)\n    \n    # chunk audio to 5sec\n    chunks = []\n    for i in range(0, len(audio), total_length):\n        sig = audio[i:i + total_length]\n        length_signal = sig.shape[0]\n        num_missing_samples = total_length - length_signal\n        sig = np.concatenate([sig, [0] * num_missing_samples])\n        \n        mel = librosa.feature.melspectrogram(sig, n_fft=800, hop_length=520, sr=target_sample_rate, fmin=20,fmax=14_000, n_mels=64)  # n_mels=1024\n        mel = librosa.amplitude_to_db(mel, top_db=100.)\n\n        mel = np.array(normalize(torch.tensor(mel).unsqueeze(0)))\n        mel = np.array(cv2.resize(mel.squeeze(), (64, 64))).reshape((1, 64, 64))\n        chunks.append(torch.tensor(mel,dtype=torch.float))\n            \n\n    test = torch.stack(chunks).to(device)\n        \n    for i in range(len(chunks)):        \n        chunk_end_time = (i + 1) * 5\n        for bird in scored_birds:\n            outputs = best_model(test[i].unsqueeze(0)).detach().cpu().numpy().argmax(1)\n            target2index = class_labels[outputs[0]]\n            try:\n                bird = test_df.loc[i, \"bird\"]\n                target = bird == target2index \n                row_id = afile + '_' + 'skylar' + '_' + str(chunk_end_time)\n                pred['row_id'].append(row_id)\n                pred['target'].append('skylar')\n            except:\n                continue`",
    "1742441": "If you work in the kaggle kernel, it automatically saves things during the session. The save version option runs and saves the notebook. No internet connection is required for the latter. How long it runs depends on your code. It will stop in error after 9 hours because that is the limit.",
    "1742832": "```\nfor i in range(12):\n            chunk_end_time = (i + 1) * 5\n            for bird in scored_birds:\n                try:\n                    score = outputs_test[i][np.where(bird_label == bird)]\n                except IndexError:\n                    score = 0\n\n                row_id = file + '_' + bird + '_' + str(chunk_end_time)\n\n                pred['row_id'].append(row_id)\n                pred['target'].append(True if score > threshold else False)\n```\n\n# I got the same error,  and you can replace \"len(chunks)\" by \"12\"",
    "1743329": "BokingChen i will try it",
    "1743733": "when I run my notebook the way BokingChen sayed, i get this input:\n```\n0      soundscape_453028782_akiapo_5   False\n1      soundscape_453028782_aniani_5   False\n2      soundscape_453028782_apapan_5   False\n3      soundscape_453028782_barpet_5   False\n4      soundscape_453028782_crehon_5   False\n..                               ...     ...\n247     soundscape_453028782_omao_60   False\n248   soundscape_453028782_puaioh_60   False\n249   soundscape_453028782_skylar_60   False\n250  soundscape_453028782_warwhe1_60   False\n251   soundscape_453028782_yefcan_60   False\n```\nthe whole sound will be applied to all the birds. Is this correct or should I modify",
    "1745005": "BokingChen thanks it worked 👍",
    "1757958": "I don't think Internet power has a relationship to the submission result because the kernel is executed by Kaggle server.\nYou can get information about error and debugging tips on this page.\nhttps://www.kaggle.com/code-competition-debugging",
    "1758425": "I solved the problem, it was from my code. but I thought  the internet is a broblem because in my country I have problem with the internet"
  },
  "source": "meta"
}