{
  "id": 167313,
  "title": "TPU without tfrecord",
  "url": "/competitions/siim-isic-melanoma-classification/discussion/167313",
  "author_name": "",
  "post_date": "2020-07-16T03:22:48.620212600Z",
  "votes": 3,
  "comment_count": 4,
  "views": 0,
  "content": "<p>It's my first competition and I don't know much, I am learning by trying different things and taking ideas from different notebooks. \nI wanted to know whether it's possible to use TPU for jpg or png format images. If yes, then is there any source from which I can understand?</p>\n\n<p>P.S. - Thanks in advance :)</p>",
  "messages": [
    {
      "id": "931168",
      "postDate": "07/16/2020 03:22:48",
      "content": "<p>It's my first competition and I don't know much, I am learning by trying different things and taking ideas from different notebooks. \nI wanted to know whether it's possible to use TPU for jpg or png format images. If yes, then is there any source from which I can understand?</p>\n\n<p>P.S. - Thanks in advance :)</p>",
      "rawMarkdown": "It's my first competition and I don't know much, I am learning by trying different things and taking ideas from different notebooks. \nI wanted to know whether it's possible to use TPU for jpg or png format images. If yes, then is there any source from which I can understand?\n\nP.S. - Thanks in advance :)",
      "votes": null
    },
    {
      "id": "931202",
      "postDate": "07/16/2020 03:57:41",
      "content": "<p>Yes, you can directly read images like this:</p>\n\n<p>```\nfilenames_dataset = tf.data.Dataset.list_files('gs://bucket-name/subfolder-name/*.jpg')</p>\n\n<p>def decode_jpeg(filename):\n  bits = tf.io.read_file(filename)\n  image = tf.image.decode_jpeg(bits)\n  return image</p>\n\n<p>image_dataset = filenames_dataset.map(decode_jpeg)</p>\n\n<p>```</p>",
      "rawMarkdown": "Yes, you can directly read images like this:\n\n```\nfilenames_dataset = tf.data.Dataset.list_files('gs://bucket-name/subfolder-name/*.jpg')\n\ndef decode_jpeg(filename):\n  bits = tf.io.read_file(filename)\n  image = tf.image.decode_jpeg(bits)\n  return image\n\nimage_dataset = filenames_dataset.map(decode_jpeg)\n\n```",
      "votes": null
    },
    {
      "id": "931449",
      "postDate": "07/16/2020 07:50:47",
      "content": "<p>Thank you for the reply. Will try implementing it. :)</p>",
      "rawMarkdown": "Thank you for the reply. Will try implementing it. :)",
      "votes": null
    },
    {
      "id": "931541",
      "postDate": "07/16/2020 09:00:46",
      "content": "<p><a href=\"/sirishks\">@sirishks</a> just another help, can you please suggest me on how can I map the images with it's label? I tried doing it with the csv file, but that didn't work properly..</p>",
      "rawMarkdown": "sirishks just another help, can you please suggest me on how can I map the images with it's label? I tried doing it with the csv file, but that didn't work properly..",
      "votes": null
    },
    {
      "id": "933053",
      "postDate": "07/17/2020 13:01:36",
      "content": "<p>Very interesting, thanks for sharing <a href=\"/sirishks\">@sirishks</a> </p>",
      "rawMarkdown": "Very interesting, thanks for sharing @sirishks",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 931202,
      "author_name": "sirishks",
      "author_url": "",
      "post_date": "07/16/2020 03:57:41",
      "content": "<p>Yes, you can directly read images like this:</p>\n\n<p>```\nfilenames_dataset = tf.data.Dataset.list_files('gs://bucket-name/subfolder-name/*.jpg')</p>\n\n<p>def decode_jpeg(filename):\n  bits = tf.io.read_file(filename)\n  image = tf.image.decode_jpeg(bits)\n  return image</p>\n\n<p>image_dataset = filenames_dataset.map(decode_jpeg)</p>\n\n<p>```</p>",
      "votes": null,
      "replies": [
        {
          "id": 931449,
          "author_name": "rohitagarwal08",
          "author_url": "",
          "post_date": "07/16/2020 07:50:47",
          "content": "<p>Thank you for the reply. Will try implementing it. :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 931541,
          "author_name": "rohitagarwal08",
          "author_url": "",
          "post_date": "07/16/2020 09:00:46",
          "content": "<p><a href=\"/sirishks\">@sirishks</a> just another help, can you please suggest me on how can I map the images with it's label? I tried doing it with the csv file, but that didn't work properly..</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 933053,
          "author_name": "kurianbenoy",
          "author_url": "",
          "post_date": "07/17/2020 13:01:36",
          "content": "<p>Very interesting, thanks for sharing <a href=\"/sirishks\">@sirishks</a> </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "931168": "It's my first competition and I don't know much, I am learning by trying different things and taking ideas from different notebooks. \nI wanted to know whether it's possible to use TPU for jpg or png format images. If yes, then is there any source from which I can understand?\n\nP.S. - Thanks in advance :)",
    "931202": "Yes, you can directly read images like this:\n\n```\nfilenames_dataset = tf.data.Dataset.list_files('gs://bucket-name/subfolder-name/*.jpg')\n\ndef decode_jpeg(filename):\n  bits = tf.io.read_file(filename)\n  image = tf.image.decode_jpeg(bits)\n  return image\n\nimage_dataset = filenames_dataset.map(decode_jpeg)\n\n```",
    "931449": "Thank you for the reply. Will try implementing it. :)",
    "931541": "sirishks just another help, can you please suggest me on how can I map the images with it's label? I tried doing it with the csv file, but that didn't work properly..",
    "933053": "Very interesting, thanks for sharing @sirishks"
  },
  "source": "meta"
}