{
  "id": 178191,
  "title": "Would you like to use TPU？",
  "url": "/competitions/birdsong-recognition/discussion/178191",
  "author_name": "ITK8191",
  "post_date": "2020-08-29T02:23:15.425000",
  "votes": 22,
  "comment_count": 13,
  "views": 0,
  "content": "<p>Hi, kaggler.<br>\nMany of the participants in this competition use Pytorch.<br>\nHowever, TPU is good for training a lot of data.<br>\nI'll propose to use a notebook with TPU.</p>\n<p><a href=\"https://www.kaggle.com/itsuki9180/birdcall-using-tpu-train\" target=\"_blank\">birdcall_using_TPU_train</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdcall-using-tpu-inference\" target=\"_blank\">birdcall_using_TPU_inference</a></p>\n<p>Try training with TPU!</p>\n<p>I will publish a dataset of images at the same time.<br>\nThe dataset contains more than 200K images such as the following</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2294613%2Fac09d01c06c0e634f95454daaf99d94f%2Faldfly-0_aldfly-00-0313.jpg?generation=1598666499468588&amp;alt=media\" alt=\"\"></p>\n<p>This image is a mel spectrogram of the pre-emphasis processed audio.<br>\nThe TPU notebooks train and infer this.</p>\n<p><a href=\"https://www.kaggle.com/itsuki9180/birdsongab\" target=\"_blank\">birdsongab</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongcf\" target=\"_blank\">birdsongcf</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsonggm\" target=\"_blank\">birdsonggm</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongnr\" target=\"_blank\">birdsongnr</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongsy\" target=\"_blank\">birdsongsy</a></p>\n<p>I hope I can contribute to your work.<br>\nI'm a newbie, so I may make a lot of mistakes.<br>\nor perhaps I should say, I feel like I'm making a big mistake.<br>\nThank you.</p>\n<p>References:<br>\n<a href=\"https://www.kaggle.com/hidehisaarai1213/inference-pytorch-birdcall-resnet-baseline\" target=\"_blank\">[inference, PyTorch] Birdcall ResNet Baseline</a><br>\n<a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu\" target=\"_blank\">Getting started with 100+ flowers on TPU</a><br>\n<a href=\"https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords\" target=\"_blank\">Triple Stratified KFold with TFRecords</a><br>\n<a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/164197\" target=\"_blank\">Resampled Train Audio on Kaggle Dataset</a></p>\n<p>(8/29 8:28 added)<br>\nI'll publish preprocessing files which I executed.<br>\n<a href=\"https://github.com/itsuki8914/BirdCall\" target=\"_blank\">Preprocessing Files</a><br>\nBrief Description<br>\npreprocess1.py<br>\nSilence removing and audio concatenation<br>\npreprocess2.py<br>\npre-emphasis and convert audio to image<br>\nJPGtoTFR.ipynb<br>\nConvert JPG to TFR</p>",
  "messages": [
    {
      "id": 989651,
      "postDate": "2020-08-29T02:23:15.427Z",
      "content": "<p>Hi, kaggler.<br>\nMany of the participants in this competition use Pytorch.<br>\nHowever, TPU is good for training a lot of data.<br>\nI'll propose to use a notebook with TPU.</p>\n<p><a href=\"https://www.kaggle.com/itsuki9180/birdcall-using-tpu-train\" target=\"_blank\">birdcall_using_TPU_train</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdcall-using-tpu-inference\" target=\"_blank\">birdcall_using_TPU_inference</a></p>\n<p>Try training with TPU!</p>\n<p>I will publish a dataset of images at the same time.<br>\nThe dataset contains more than 200K images such as the following</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2294613%2Fac09d01c06c0e634f95454daaf99d94f%2Faldfly-0_aldfly-00-0313.jpg?generation=1598666499468588&amp;alt=media\" alt=\"\"></p>\n<p>This image is a mel spectrogram of the pre-emphasis processed audio.<br>\nThe TPU notebooks train and infer this.</p>\n<p><a href=\"https://www.kaggle.com/itsuki9180/birdsongab\" target=\"_blank\">birdsongab</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongcf\" target=\"_blank\">birdsongcf</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsonggm\" target=\"_blank\">birdsonggm</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongnr\" target=\"_blank\">birdsongnr</a><br>\n<a href=\"https://www.kaggle.com/itsuki9180/birdsongsy\" target=\"_blank\">birdsongsy</a></p>\n<p>I hope I can contribute to your work.<br>\nI'm a newbie, so I may make a lot of mistakes.<br>\nor perhaps I should say, I feel like I'm making a big mistake.<br>\nThank you.</p>\n<p>References:<br>\n<a href=\"https://www.kaggle.com/hidehisaarai1213/inference-pytorch-birdcall-resnet-baseline\" target=\"_blank\">[inference, PyTorch] Birdcall ResNet Baseline</a><br>\n<a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu\" target=\"_blank\">Getting started with 100+ flowers on TPU</a><br>\n<a href=\"https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords\" target=\"_blank\">Triple Stratified KFold with TFRecords</a><br>\n<a href=\"https://www.kaggle.com/c/birdsong-recognition/discussion/164197\" target=\"_blank\">Resampled Train Audio on Kaggle Dataset</a></p>\n<p>(8/29 8:28 added)<br>\nI'll publish preprocessing files which I executed.<br>\n<a href=\"https://github.com/itsuki8914/BirdCall\" target=\"_blank\">Preprocessing Files</a><br>\nBrief Description<br>\npreprocess1.py<br>\nSilence removing and audio concatenation<br>\npreprocess2.py<br>\npre-emphasis and convert audio to image<br>\nJPGtoTFR.ipynb<br>\nConvert JPG to TFR</p>",
      "rawMarkdown": "Hi, kaggler.\nMany of the participants in this competition use Pytorch.\nHowever, TPU is good for training a lot of data.\nI'll propose to use a notebook with TPU.\n\n[birdcall_using_TPU_train](https://www.kaggle.com/itsuki9180/birdcall-using-tpu-train)\n[birdcall_using_TPU_inference](https://www.kaggle.com/itsuki9180/birdcall-using-tpu-inference)\n\nTry training with TPU!\n\nI will publish a dataset of images at the same time.\nThe dataset contains more than 200K images such as the following\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2294613%2Fac09d01c06c0e634f95454daaf99d94f%2Faldfly-0_aldfly-00-0313.jpg?generation=1598666499468588&alt=media)\n\nThis image is a mel spectrogram of the pre-emphasis processed audio.\nThe TPU notebooks train and infer this.\n\n[birdsongab](https://www.kaggle.com/itsuki9180/birdsongab)\n[birdsongcf](https://www.kaggle.com/itsuki9180/birdsongcf)\n[birdsonggm](https://www.kaggle.com/itsuki9180/birdsonggm)\n[birdsongnr](https://www.kaggle.com/itsuki9180/birdsongnr)\n[birdsongsy](https://www.kaggle.com/itsuki9180/birdsongsy)\n\nI hope I can contribute to your work.\nI'm a newbie, so I may make a lot of mistakes.\nor perhaps I should say, I feel like I'm making a big mistake.\nThank you.\n\nReferences:\n[[inference, PyTorch] Birdcall ResNet Baseline](https://www.kaggle.com/hidehisaarai1213/inference-pytorch-birdcall-resnet-baseline)\n[Getting started with 100+ flowers on TPU](https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu)\n[Triple Stratified KFold with TFRecords](https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords)\n[Resampled Train Audio on Kaggle Dataset](https://www.kaggle.com/c/birdsong-recognition/discussion/164197)\n\n(8/29 8:28 added)\nI'll publish preprocessing files which I executed.\n[Preprocessing Files](https://github.com/itsuki8914/BirdCall)\nBrief Description\npreprocess1.py\nSilence removing and audio concatenation\npreprocess2.py\npre-emphasis and convert audio to image\nJPGtoTFR.ipynb\nConvert JPG to TFR\n",
      "votes": 22
    },
    {
      "id": 991381,
      "postDate": "2020-08-30T11:18:34.120Z",
      "content": "<p>Thanks for the great post.<br>\nI have a question.<br>\nI'm talking about the process of creating a tfrecode.<br>\n1.preprocess1.py do<br>\n2.preprocess2.py do<br>\n3.JPGtoTFR.ipynb do <br>\nIs that correct?<br>\nAlso, where should I quote the speech_tools in preprocess1.py?<br>\nI tried to run preprocess1.py in the local environment, but I couldn't find speech_tools.</p>",
      "rawMarkdown": "Thanks for the great post.\nI have a question.\nI'm talking about the process of creating a tfrecode.\n1.preprocess1.py do\n2.preprocess2.py do\n3.JPGtoTFR.ipynb do \nIs that correct?\nAlso, where should I quote the speech_tools in preprocess1.py?\nI tried to run preprocess1.py in the local environment, but I couldn't find speech_tools.",
      "votes": 1,
      "replies": [
        {
          "id": 991411,
          "postDate": "2020-08-30T11:54:08.257Z",
          "content": "<p>Please delete that line.<br>\nI forgot to delete it because I was diverting the code for speech processing.<br>\nclone again or import them<br>\n<code>\nimport librosa\n</code><br>\n<code>\nimport numpy as np\n</code><br>\n<code>\nimport glob\n</code><br>\nThe order of execution of code is correct.<br>\nYou may need to rename the folder in these codes.</p>",
          "rawMarkdown": "Please delete that line.\nI forgot to delete it because I was diverting the code for speech processing.\nclone again or import them\n`\nimport librosa\n`\n`\nimport numpy as np\n`\n`\nimport glob\n`\nThe order of execution of code is correct.\nYou may need to rename the folder in these codes.",
          "votes": 1
        },
        {
          "id": 992230,
          "postDate": "2020-08-31T04:10:45.340Z",
          "content": "<p>I understand!</p>\n<p>Thanks for the thoughtful answer!</p>",
          "rawMarkdown": "I understand!\n\nThanks for the thoughtful answer!",
          "votes": 1
        }
      ]
    },
    {
      "id": 989873,
      "postDate": "2020-08-29T07:00:33.653Z",
      "content": "<p>hi, as per the rules, TPU is not allowed. Feel free to use for practice and training<br>\nbut submit a model using GPU or CPU in submission, else your notebook will be disqualified</p>",
      "rawMarkdown": "hi, as per the rules, TPU is not allowed. Feel free to use for practice and training\nbut submit a model using GPU or CPU in submission, else your notebook will be disqualified\n\n",
      "votes": 1,
      "replies": [
        {
          "id": 989928,
          "postDate": "2020-08-29T08:13:30.117Z",
          "content": "<p><a href=\"https://www.kaggle.com/kmldas\" target=\"_blank\">@kmldas</a> , I think the inference kernel is not TPU. </p>",
          "rawMarkdown": "@kmldas , I think the inference kernel is not TPU. ",
          "votes": 1
        },
        {
          "id": 989970,
          "postDate": "2020-08-29T08:42:04.107Z",
          "content": "<p><a href=\"https://www.kaggle.com/kmldas\" target=\"_blank\">@kmldas</a> <br>\nsorry for confusing expression.<br>\nInference is executed with GPU.</p>",
          "rawMarkdown": "@kmldas \nsorry for confusing expression.\nInference is executed with GPU.",
          "votes": 2
        },
        {
          "id": 989978,
          "postDate": "2020-08-29T08:45:49.170Z",
          "content": "<p>thanks … as GPU and not TPU <br>\nit should be fine!</p>",
          "rawMarkdown": "thanks ... as GPU and not TPU \nit should be fine!\n",
          "votes": 1
        }
      ]
    },
    {
      "id": 989753,
      "postDate": "2020-08-29T05:07:40.173Z",
      "content": "<p>Thank you for sharing the code - I still have gone through it completely, but it looks good at first sight.<br>\nCan you share the code for sharing tfrecords please.</p>",
      "rawMarkdown": "Thank you for sharing the code - I still have gone through it completely, but it looks good at first sight.\nCan you share the code for sharing tfrecords please.",
      "votes": 1,
      "replies": [
        {
          "id": 989967,
          "postDate": "2020-08-29T08:40:48.443Z",
          "content": "<p><a href=\"https://github.com/itsuki8914/BirdCall\" target=\"_blank\">here</a>.<br>\nPlease correct as appropriate.<br>\nThese may have defects.<br>\nyou can inprove it.</p>",
          "rawMarkdown": "[here](https://github.com/itsuki8914/BirdCall).\nPlease correct as appropriate.\nThese may have defects.\nyou can inprove it.",
          "votes": 2
        }
      ]
    },
    {
      "id": 989710,
      "postDate": "2020-08-29T04:16:24.980Z",
      "content": "<p>Thanks so much!! This will greatly reduce the training time and can experiment more within limited time!</p>",
      "rawMarkdown": "Thanks so much!! This will greatly reduce the training time and can experiment more within limited time!\n",
      "votes": 1
    },
    {
      "id": 993637,
      "postDate": "2020-09-01T04:56:22.620Z",
      "content": "<p>The training phase runs for only 18-20 epochs but I gave around 30 epochs what could be the reason?</p>",
      "rawMarkdown": "The training phase runs for only 18-20 epochs but I gave around 30 epochs what could be the reason?",
      "replies": [
        {
          "id": 993912,
          "postDate": "2020-09-01T08:16:09.740Z",
          "content": "<p>Training is stopped by EarlyStopping.<br>\nI removed ES in my newest notebook.<br>\nIt seems many epochs can enhance score.</p>",
          "rawMarkdown": "Training is stopped by EarlyStopping.\nI removed ES in my newest notebook.\nIt seems many epochs can enhance score."
        }
      ]
    },
    {
      "id": 990383,
      "postDate": "2020-08-29T15:15:30.687Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 991381,
      "author_name": "SHINO",
      "author_url": "",
      "post_date": "2020-08-30T11:18:34.120000",
      "content": "<p>Thanks for the great post.<br>\nI have a question.<br>\nI'm talking about the process of creating a tfrecode.<br>\n1.preprocess1.py do<br>\n2.preprocess2.py do<br>\n3.JPGtoTFR.ipynb do <br>\nIs that correct?<br>\nAlso, where should I quote the speech_tools in preprocess1.py?<br>\nI tried to run preprocess1.py in the local environment, but I couldn't find speech_tools.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 991411,
          "author_name": "ITK8191",
          "author_url": "",
          "post_date": "2020-08-30T11:54:08.257000",
          "content": "<p>Please delete that line.<br>\nI forgot to delete it because I was diverting the code for speech processing.<br>\nclone again or import them<br>\n<code>\nimport librosa\n</code><br>\n<code>\nimport numpy as np\n</code><br>\n<code>\nimport glob\n</code><br>\nThe order of execution of code is correct.<br>\nYou may need to rename the folder in these codes.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 992230,
          "author_name": "SHINO",
          "author_url": "",
          "post_date": "2020-08-31T04:10:45.340000",
          "content": "<p>I understand!</p>\n<p>Thanks for the thoughtful answer!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 989873,
      "author_name": "Kamal Das",
      "author_url": "",
      "post_date": "2020-08-29T07:00:33.653000",
      "content": "<p>hi, as per the rules, TPU is not allowed. Feel free to use for practice and training<br>\nbut submit a model using GPU or CPU in submission, else your notebook will be disqualified</p>",
      "votes": 1,
      "replies": [
        {
          "id": 989928,
          "author_name": "YaGana Sheriff-Hussaini",
          "author_url": "",
          "post_date": "2020-08-29T08:13:30.117000",
          "content": "<p><a href=\"https://www.kaggle.com/kmldas\" target=\"_blank\">@kmldas</a> , I think the inference kernel is not TPU. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 989970,
          "author_name": "ITK8191",
          "author_url": "",
          "post_date": "2020-08-29T08:42:04.107000",
          "content": "<p><a href=\"https://www.kaggle.com/kmldas\" target=\"_blank\">@kmldas</a> <br>\nsorry for confusing expression.<br>\nInference is executed with GPU.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 989978,
          "author_name": "Kamal Das",
          "author_url": "",
          "post_date": "2020-08-29T08:45:49.170000",
          "content": "<p>thanks … as GPU and not TPU <br>\nit should be fine!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 989753,
      "author_name": "Vee",
      "author_url": "",
      "post_date": "2020-08-29T05:07:40.173000",
      "content": "<p>Thank you for sharing the code - I still have gone through it completely, but it looks good at first sight.<br>\nCan you share the code for sharing tfrecords please.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 989967,
          "author_name": "ITK8191",
          "author_url": "",
          "post_date": "2020-08-29T08:40:48.443000",
          "content": "<p><a href=\"https://github.com/itsuki8914/BirdCall\" target=\"_blank\">here</a>.<br>\nPlease correct as appropriate.<br>\nThese may have defects.<br>\nyou can inprove it.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 989710,
      "author_name": "Salaryman",
      "author_url": "",
      "post_date": "2020-08-29T04:16:24.980000",
      "content": "<p>Thanks so much!! This will greatly reduce the training time and can experiment more within limited time!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 993637,
      "author_name": "Convophile",
      "author_url": "",
      "post_date": "2020-09-01T04:56:22.620000",
      "content": "<p>The training phase runs for only 18-20 epochs but I gave around 30 epochs what could be the reason?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 993912,
          "author_name": "ITK8191",
          "author_url": "",
          "post_date": "2020-09-01T08:16:09.740000",
          "content": "<p>Training is stopped by EarlyStopping.<br>\nI removed ES in my newest notebook.<br>\nIt seems many epochs can enhance score.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 990383,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-08-29T15:15:30.687000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "989651": "Hi, kaggler.\nMany of the participants in this competition use Pytorch.\nHowever, TPU is good for training a lot of data.\nI'll propose to use a notebook with TPU.\n\n[birdcall_using_TPU_train](https://www.kaggle.com/itsuki9180/birdcall-using-tpu-train)\n[birdcall_using_TPU_inference](https://www.kaggle.com/itsuki9180/birdcall-using-tpu-inference)\n\nTry training with TPU!\n\nI will publish a dataset of images at the same time.\nThe dataset contains more than 200K images such as the following\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2294613%2Fac09d01c06c0e634f95454daaf99d94f%2Faldfly-0_aldfly-00-0313.jpg?generation=1598666499468588&alt=media)\n\nThis image is a mel spectrogram of the pre-emphasis processed audio.\nThe TPU notebooks train and infer this.\n\n[birdsongab](https://www.kaggle.com/itsuki9180/birdsongab)\n[birdsongcf](https://www.kaggle.com/itsuki9180/birdsongcf)\n[birdsonggm](https://www.kaggle.com/itsuki9180/birdsonggm)\n[birdsongnr](https://www.kaggle.com/itsuki9180/birdsongnr)\n[birdsongsy](https://www.kaggle.com/itsuki9180/birdsongsy)\n\nI hope I can contribute to your work.\nI'm a newbie, so I may make a lot of mistakes.\nor perhaps I should say, I feel like I'm making a big mistake.\nThank you.\n\nReferences:\n[[inference, PyTorch] Birdcall ResNet Baseline](https://www.kaggle.com/hidehisaarai1213/inference-pytorch-birdcall-resnet-baseline)\n[Getting started with 100+ flowers on TPU](https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu)\n[Triple Stratified KFold with TFRecords](https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords)\n[Resampled Train Audio on Kaggle Dataset](https://www.kaggle.com/c/birdsong-recognition/discussion/164197)\n\n(8/29 8:28 added)\nI'll publish preprocessing files which I executed.\n[Preprocessing Files](https://github.com/itsuki8914/BirdCall)\nBrief Description\npreprocess1.py\nSilence removing and audio concatenation\npreprocess2.py\npre-emphasis and convert audio to image\nJPGtoTFR.ipynb\nConvert JPG to TFR\n",
    "991381": "Thanks for the great post.\nI have a question.\nI'm talking about the process of creating a tfrecode.\n1.preprocess1.py do\n2.preprocess2.py do\n3.JPGtoTFR.ipynb do \nIs that correct?\nAlso, where should I quote the speech_tools in preprocess1.py?\nI tried to run preprocess1.py in the local environment, but I couldn't find speech_tools.",
    "989873": "hi, as per the rules, TPU is not allowed. Feel free to use for practice and training\nbut submit a model using GPU or CPU in submission, else your notebook will be disqualified\n\n",
    "989753": "Thank you for sharing the code - I still have gone through it completely, but it looks good at first sight.\nCan you share the code for sharing tfrecords please.",
    "989710": "Thanks so much!! This will greatly reduce the training time and can experiment more within limited time!\n",
    "993637": "The training phase runs for only 18-20 epochs but I gave around 30 epochs what could be the reason?",
    "990383": ""
  }
}