{
  "id": 152171,
  "title": "Custom Keras generator with TPU",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/152171",
  "author_name": "PAB97",
  "post_date": "2020-05-18T17:44:46.402000",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hello everyone, </p>\n\n<p>I'm trying to implement a workflow using TPU. So far I have a fully working workflow using GPU and a custom ImageGenerator with Keras. However, I know that I need to use tf.data with TPU. I need to do some preprocessing on the image as you might expect (cutting and zooming + data augmentation) and I don't know how to do it using tf.data...</p>\n\n<p>Should I write a generator feeding my dataset? Any ideas is welcome.</p>\n\n<p>Many thanks in advance</p>",
  "messages": [
    {
      "id": 852821,
      "postDate": "2020-05-18T17:44:46.403Z",
      "content": "<p>Hello everyone, </p>\n\n<p>I'm trying to implement a workflow using TPU. So far I have a fully working workflow using GPU and a custom ImageGenerator with Keras. However, I know that I need to use tf.data with TPU. I need to do some preprocessing on the image as you might expect (cutting and zooming + data augmentation) and I don't know how to do it using tf.data...</p>\n\n<p>Should I write a generator feeding my dataset? Any ideas is welcome.</p>\n\n<p>Many thanks in advance</p>",
      "rawMarkdown": "Hello everyone, \n\nI'm trying to implement a workflow using TPU. So far I have a fully working workflow using GPU and a custom ImageGenerator with Keras. However, I know that I need to use tf.data with TPU. I need to do some preprocessing on the image as you might expect (cutting and zooming + data augmentation) and I don't know how to do it using tf.data...\n\nShould I write a generator feeding my dataset? Any ideas is welcome.\n\nMany thanks in advance",
      "votes": 1
    },
    {
      "id": 867807,
      "postDate": "2020-05-30T16:31:15.160Z",
      "content": "<p>Check this link @rftexax</p>\n\n<p><a href=\"https://www.tensorflow.org/guide/data#preprocessing_data\">https://www.tensorflow.org/guide/data#preprocessing_data</a></p>",
      "rawMarkdown": "Check this link @rftexax\n\nhttps://www.tensorflow.org/guide/data#preprocessing_data"
    }
  ],
  "comments": [
    {
      "id": 867807,
      "author_name": "Kurian Benoy",
      "author_url": "",
      "post_date": "2020-05-30T16:31:15.160000",
      "content": "<p>Check this link @rftexax</p>\n\n<p><a href=\"https://www.tensorflow.org/guide/data#preprocessing_data\">https://www.tensorflow.org/guide/data#preprocessing_data</a></p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "852821": "Hello everyone, \n\nI'm trying to implement a workflow using TPU. So far I have a fully working workflow using GPU and a custom ImageGenerator with Keras. However, I know that I need to use tf.data with TPU. I need to do some preprocessing on the image as you might expect (cutting and zooming + data augmentation) and I don't know how to do it using tf.data...\n\nShould I write a generator feeding my dataset? Any ideas is welcome.\n\nMany thanks in advance",
    "867807": "Check this link @rftexax\n\nhttps://www.tensorflow.org/guide/data#preprocessing_data"
  }
}