{
  "id": 200260,
  "title": "Different Image Dimension according to accelerator. ",
  "url": "/competitions/hubmap-kidney-segmentation/discussion/200260",
  "author_name": "",
  "post_date": "2020-11-29T17:51:29.631045200Z",
  "votes": 5,
  "comment_count": 8,
  "views": 0,
  "content": "<p>While playing around with Images during EDA I come to notice this unusual behaviour. Please check if anyone is getting the same after switching to different accelerators and reading in images. Well maybe this isn't a big deal but I thought it would be better if everyone notices this. </p>\n<h4>SORRY FOR THE IMAGE QUALITY.</h4>\n<h2>ON CPU</h2>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1358d32c642b0750f6ba3e0c0db372a1%2FScreenshot%20(146).png?generation=1606671092011827&amp;alt=media\" alt=\"\"></p>\n<p>The shape of the images while using CPU seems different. Later images have a shape something like (1, 1, 2, H, W)</p>\n<h2>ON TPU</h2>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1c6932617b6d6303a43ba5303a151833%2FScreenshot%20(145).png?generation=1606671194826515&amp;alt=media\" alt=\"\"></p>\n<p>While using TPU the channel seems to appear first. Some later images have a shape such as (C, H, W)</p>",
  "messages": [
    {
      "id": "1095539",
      "postDate": "11/29/2020 17:51:29",
      "content": "<p>While playing around with Images during EDA I come to notice this unusual behaviour. Please check if anyone is getting the same after switching to different accelerators and reading in images. Well maybe this isn't a big deal but I thought it would be better if everyone notices this. </p>\n<h4>SORRY FOR THE IMAGE QUALITY.</h4>\n<h2>ON CPU</h2>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1358d32c642b0750f6ba3e0c0db372a1%2FScreenshot%20(146).png?generation=1606671092011827&amp;alt=media\" alt=\"\"></p>\n<p>The shape of the images while using CPU seems different. Later images have a shape something like (1, 1, 2, H, W)</p>\n<h2>ON TPU</h2>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1c6932617b6d6303a43ba5303a151833%2FScreenshot%20(145).png?generation=1606671194826515&amp;alt=media\" alt=\"\"></p>\n<p>While using TPU the channel seems to appear first. Some later images have a shape such as (C, H, W)</p>",
      "rawMarkdown": "While playing around with Images during EDA I come to notice this unusual behaviour. Please check if anyone is getting the same after switching to different accelerators and reading in images. Well maybe this isn't a big deal but I thought it would be better if everyone notices this. \n\n#### SORRY FOR THE IMAGE QUALITY. \n\n\n## ON CPU\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1358d32c642b0750f6ba3e0c0db372a1%2FScreenshot%20(146).png?generation=1606671092011827&alt=media)\n\nThe shape of the images while using CPU seems different. Later images have a shape something like (1, 1, 2, H, W)\n\n## ON TPU\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1c6932617b6d6303a43ba5303a151833%2FScreenshot%20(145).png?generation=1606671194826515&alt=media)\n\nWhile using TPU the channel seems to appear first. Some later images have a shape such as (C, H, W)",
      "votes": null
    },
    {
      "id": "1095569",
      "postDate": "11/29/2020 18:13:43",
      "content": "<p>The two extra dimensions of size 1 can be got rid of by applying np.squeeze() or a similar function. They are meaningless.<br>\nI am guessing their appearance in one run and not the other is due to the tifffile package version difference between the two instances (TPU-enabled, and CPU-only).<br>\nYou need to watch out for channel-first and channel-last - some input images have the former, some the latter.<br>\nAlso, I don't think you will be able to use TPU in your submission notebook, as TPU requires internet access and the submission notebooks are not allowed internet access.</p>",
      "rawMarkdown": "The two extra dimensions of size 1 can be got rid of by applying np.squeeze() or a similar function. They are meaningless.\nI am guessing their appearance in one run and not the other is due to the tifffile package version difference between the two instances (TPU-enabled, and CPU-only).\nYou need to watch out for channel-first and channel-last - some input images have the former, some the latter.\nAlso, I don't think you will be able to use TPU in your submission notebook, as TPU requires internet access and the submission notebooks are not allowed internet access.",
      "votes": null
    },
    {
      "id": "1095597",
      "postDate": "11/29/2020 18:38:58",
      "content": "<p>use of TPUs is allowed in the competition and the example notebooks demonstrates them as well. Hope this is helpful. </p>",
      "rawMarkdown": "use of TPUs is allowed in the competition and the example notebooks demonstrates them as well. Hope this is helpful.",
      "votes": null
    },
    {
      "id": "1095632",
      "postDate": "11/29/2020 19:48:54",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/budsims\" target=\"_blank\">@budsims</a> ,<br>\nWhat about the use of TPU for the inference? <br>\nThere are no clear instructions around this, on this <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/overview/code-requirements\" target=\"_blank\">page</a>.</p>",
      "rawMarkdown": "Hey @budsims ,\nWhat about the use of TPU for the inference? \nThere are no clear instructions around this, on this [page](https://www.kaggle.com/c/hubmap-kidney-segmentation/overview/code-requirements).",
      "votes": null
    },
    {
      "id": "1095755",
      "postDate": "11/29/2020 23:03:45",
      "content": "<p>TPU submission is allowed as long as the runtime of the notebook &lt;= 3 hours.</p>",
      "rawMarkdown": "TPU submission is allowed as long as the runtime of the notebook <= 3 hours.",
      "votes": null
    },
    {
      "id": "1095758",
      "postDate": "11/29/2020 23:11:03",
      "content": "<p><a href=\"https://www.kaggle.com/aroraaman\" target=\"_blank\">@aroraaman</a> See <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/199750\" target=\"_blank\">here</a>. For some reason, TPU isn't allowed during submission.</p>",
      "rawMarkdown": "aroraaman See [here](https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/199750). For some reason, TPU isn't allowed during submission.",
      "votes": null
    },
    {
      "id": "1095972",
      "postDate": "11/30/2020 05:30:07",
      "content": "<p>Also, when I submitted with TPU, runtime was less that 3 hr.</p>",
      "rawMarkdown": "Also, when I submitted with TPU, runtime was less that 3 hr.",
      "votes": null
    },
    {
      "id": "1096657",
      "postDate": "11/30/2020 17:09:40",
      "content": "<p><a href=\"https://www.kaggle.com/joshi98kishan\" target=\"_blank\">@joshi98kishan</a> -- we published the information here, but the short answer is train with TPU/Internet and submit with GPU/private <a href=\"https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu\" target=\"_blank\">https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu</a> </p>",
      "rawMarkdown": "joshi98kishan -- we published the information here, but the short answer is train with TPU/Internet and submit with GPU/private [https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu](https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu)",
      "votes": null
    },
    {
      "id": "1096664",
      "postDate": "11/30/2020 17:17:16",
      "content": "<p>Okay, thank you. <a href=\"https://www.kaggle.com/budsims\" target=\"_blank\">@budsims</a> </p>",
      "rawMarkdown": "Okay, thank you. @budsims",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1095569,
      "author_name": "igor14497",
      "author_url": "",
      "post_date": "11/29/2020 18:13:43",
      "content": "<p>The two extra dimensions of size 1 can be got rid of by applying np.squeeze() or a similar function. They are meaningless.<br>\nI am guessing their appearance in one run and not the other is due to the tifffile package version difference between the two instances (TPU-enabled, and CPU-only).<br>\nYou need to watch out for channel-first and channel-last - some input images have the former, some the latter.<br>\nAlso, I don't think you will be able to use TPU in your submission notebook, as TPU requires internet access and the submission notebooks are not allowed internet access.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1095597,
          "author_name": "budsims",
          "author_url": "",
          "post_date": "11/29/2020 18:38:58",
          "content": "<p>use of TPUs is allowed in the competition and the example notebooks demonstrates them as well. Hope this is helpful. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1095632,
          "author_name": "joshi98kishan",
          "author_url": "",
          "post_date": "11/29/2020 19:48:54",
          "content": "<p>Hey <a href=\"https://www.kaggle.com/budsims\" target=\"_blank\">@budsims</a> ,<br>\nWhat about the use of TPU for the inference? <br>\nThere are no clear instructions around this, on this <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/overview/code-requirements\" target=\"_blank\">page</a>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1095755,
          "author_name": "aroraaman",
          "author_url": "",
          "post_date": "11/29/2020 23:03:45",
          "content": "<p>TPU submission is allowed as long as the runtime of the notebook &lt;= 3 hours.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1095758,
          "author_name": "matthewmasters",
          "author_url": "",
          "post_date": "11/29/2020 23:11:03",
          "content": "<p><a href=\"https://www.kaggle.com/aroraaman\" target=\"_blank\">@aroraaman</a> See <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/199750\" target=\"_blank\">here</a>. For some reason, TPU isn't allowed during submission.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1095972,
          "author_name": "joshi98kishan",
          "author_url": "",
          "post_date": "11/30/2020 05:30:07",
          "content": "<p>Also, when I submitted with TPU, runtime was less that 3 hr.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1096657,
          "author_name": "budsims",
          "author_url": "",
          "post_date": "11/30/2020 17:09:40",
          "content": "<p><a href=\"https://www.kaggle.com/joshi98kishan\" target=\"_blank\">@joshi98kishan</a> -- we published the information here, but the short answer is train with TPU/Internet and submit with GPU/private <a href=\"https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu\" target=\"_blank\">https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu</a> </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1096664,
          "author_name": "joshi98kishan",
          "author_url": "",
          "post_date": "11/30/2020 17:17:16",
          "content": "<p>Okay, thank you. <a href=\"https://www.kaggle.com/budsims\" target=\"_blank\">@budsims</a> </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1095539": "While playing around with Images during EDA I come to notice this unusual behaviour. Please check if anyone is getting the same after switching to different accelerators and reading in images. Well maybe this isn't a big deal but I thought it would be better if everyone notices this. \n\n#### SORRY FOR THE IMAGE QUALITY. \n\n\n## ON CPU\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1358d32c642b0750f6ba3e0c0db372a1%2FScreenshot%20(146).png?generation=1606671092011827&alt=media)\n\nThe shape of the images while using CPU seems different. Later images have a shape something like (1, 1, 2, H, W)\n\n## ON TPU\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2167036%2F1c6932617b6d6303a43ba5303a151833%2FScreenshot%20(145).png?generation=1606671194826515&alt=media)\n\nWhile using TPU the channel seems to appear first. Some later images have a shape such as (C, H, W)",
    "1095569": "The two extra dimensions of size 1 can be got rid of by applying np.squeeze() or a similar function. They are meaningless.\nI am guessing their appearance in one run and not the other is due to the tifffile package version difference between the two instances (TPU-enabled, and CPU-only).\nYou need to watch out for channel-first and channel-last - some input images have the former, some the latter.\nAlso, I don't think you will be able to use TPU in your submission notebook, as TPU requires internet access and the submission notebooks are not allowed internet access.",
    "1095597": "use of TPUs is allowed in the competition and the example notebooks demonstrates them as well. Hope this is helpful.",
    "1095632": "Hey @budsims ,\nWhat about the use of TPU for the inference? \nThere are no clear instructions around this, on this [page](https://www.kaggle.com/c/hubmap-kidney-segmentation/overview/code-requirements).",
    "1095755": "TPU submission is allowed as long as the runtime of the notebook <= 3 hours.",
    "1095758": "aroraaman See [here](https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/199750). For some reason, TPU isn't allowed during submission.",
    "1095972": "Also, when I submitted with TPU, runtime was less that 3 hr.",
    "1096657": "joshi98kishan -- we published the information here, but the short answer is train with TPU/Internet and submit with GPU/private [https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu](https://www.kaggle.com/marcosnovaes/hubmap-unet-keras-model-fit-with-tpu)",
    "1096664": "Okay, thank you. @budsims"
  },
  "source": "meta"
}