{
  "id": 144398,
  "title": "Image Generator on TPU",
  "url": "/competitions/flower-classification-with-tpus/discussion/144398",
  "author_name": "pawan verma",
  "post_date": "2020-04-18T20:34:28.467000",
  "votes": 3,
  "comment_count": 11,
  "views": 0,
  "content": "<p>Hi, i am trying to augment images using ImageGenerator. However, fit_generator method is  throwing error on TPU.\n<code>\nNotFoundError: {{function_node __inference_train_function_662461}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n    .  Registered:  &lt;no registered kernels&gt;\n</code>\nPlease help.</p>",
  "messages": [
    {
      "id": 815583,
      "postDate": "2020-04-21T16:50:36.610Z",
      "content": "<p><a href=\"/cdeotte\">@cdeotte</a> has created two excellent notebooks for using augmentations with TPUs that should help get you started!\n- <a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132191\">How To: Rotation Augmentation</a>\n- <a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132935\">How To: CutMix MixUP</a></p>",
      "rawMarkdown": "@cdeotte has created two excellent notebooks for using augmentations with TPUs that should help get you started!\n- [How To: Rotation Augmentation](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132191)\n- [How To: CutMix MixUP](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132935)",
      "votes": 3,
      "replies": [
        {
          "id": 815599,
          "postDate": "2020-04-21T17:06:08.080Z",
          "content": "<p>Thanks! Will surely look .</p>",
          "rawMarkdown": "Thanks! Will surely look ."
        }
      ]
    },
    {
      "id": 812581,
      "postDate": "2020-04-18T20:34:28.467Z",
      "content": "<p>Hi, i am trying to augment images using ImageGenerator. However, fit_generator method is  throwing error on TPU.\n<code>\nNotFoundError: {{function_node __inference_train_function_662461}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n    .  Registered:  &lt;no registered kernels&gt;\n</code>\nPlease help.</p>",
      "rawMarkdown": "Hi, i am trying to augment images using ImageGenerator. However, fit_generator method is  throwing error on TPU.\n```\nNotFoundError: {{function_node __inference_train_function_662461}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n\t.  Registered:  ",
      "votes": 3
    },
    {
      "id": 820277,
      "postDate": "2020-04-25T09:42:51.003Z",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a>  I got the same error as above but I don't want to do data augmentation but when I try to load the images using imagedatagenrator and try to use TPU I can't do it and getting the same error. Please help</p>",
      "rawMarkdown": "@jessemostipak  I got the same error as above but I don't want to do data augmentation but when I try to load the images using imagedatagenrator and try to use TPU I can't do it and getting the same error. Please help",
      "votes": 1,
      "replies": [
        {
          "id": 823306,
          "postDate": "2020-04-27T14:51:57.160Z",
          "content": "<p>it's difficult to tell what's happening without seeing your code, but I can recommend following the <a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/\">Getting Started notebook for this competition</a> - everything in here works, and this notebook is a great way to get up and running with TPUs and the Flower Classification dataset.</p>",
          "rawMarkdown": "it's difficult to tell what's happening without seeing your code, but I can recommend following the [Getting Started notebook for this competition](https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/) - everything in here works, and this notebook is a great way to get up and running with TPUs and the Flower Classification dataset."
        },
        {
          "id": 823692,
          "postDate": "2020-04-27T20:07:51.537Z",
          "content": "<p>The ImageDataGenerator utility from Keras will not work on TPUs. Load your images normally through the tf.data.Dataset API as in the <a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/\">TPU starter notebook</a>.</p>",
          "rawMarkdown": "The ImageDataGenerator utility from Keras will not work on TPUs. Load your images normally through the tf.data.Dataset API as in the [TPU starter notebook](https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/)."
        }
      ]
    },
    {
      "id": 828948,
      "postDate": "2020-05-01T12:04:48.010Z",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a> Okk if the notebook doesn't open (try copy and edit option then you can see full code), but can you suggest me a way where I can load 100000 images normal RGB format and train that model on TPU.</p>",
      "rawMarkdown": "@jessemostipak Okk if the notebook doesn't open (try copy and edit option then you can see full code), but can you suggest me a way where I can load 100000 images normal RGB format and train that model on TPU."
    },
    {
      "id": 825747,
      "postDate": "2020-04-29T08:07:08.233Z",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a> <a href=\"/mgornergoogle\">@mgornergoogle</a>  As you ask here is my notebook where I want to train my model with TPU.\nPlease do whatever you want to but help me so that I can train my model with TPU.\n<a href=\"https://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251\">https://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251</a></p>",
      "rawMarkdown": "@jessemostipak @mgornergoogle  As you ask here is my notebook where I want to train my model with TPU.\nPlease do whatever you want to but help me so that I can train my model with TPU.\nhttps://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251",
      "replies": [
        {
          "id": 828010,
          "postDate": "2020-04-30T17:47:51.497Z",
          "content": "<p>thanks for sharing the notebook! 3unfortunately when I try to open it it freezes and I can't see anything beyond the first code block. as Martin mentioned in an earlier reply, do make sure that you're loading images through the tf.data.Dataset API!</p>",
          "rawMarkdown": "thanks for sharing the notebook! 3unfortunately when I try to open it it freezes and I can't see anything beyond the first code block. as Martin mentioned in an earlier reply, do make sure that you're loading images through the tf.data.Dataset API!"
        }
      ]
    },
    {
      "id": 812736,
      "postDate": "2020-04-19T02:59:57.827Z",
      "content": "<p><a href=\"/pawanverma\">@pawanverma</a> did you mean keras ImageGenerator?</p>\n\n<p>Augmentation libraries are not by default supported in TPU</p>",
      "rawMarkdown": "@pawanverma did you mean keras ImageGenerator?\n\nAugmentation libraries are not by default supported in TPU",
      "replies": [
        {
          "id": 812980,
          "postDate": "2020-04-19T09:36:13.813Z",
          "content": "<p>Yes, i was trying to run keras ImageGenerator. Any other method to generate on the fly augmentation</p>",
          "rawMarkdown": "Yes, i was trying to run keras ImageGenerator. Any other method to generate on the fly augmentation"
        }
      ]
    },
    {
      "id": 832307,
      "postDate": "2020-05-04T03:27:36.403Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 815583,
      "author_name": "Jesse Mostipak",
      "author_url": "",
      "post_date": "2020-04-21T16:50:36.610000",
      "content": "<p><a href=\"/cdeotte\">@cdeotte</a> has created two excellent notebooks for using augmentations with TPUs that should help get you started!\n- <a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132191\">How To: Rotation Augmentation</a>\n- <a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132935\">How To: CutMix MixUP</a></p>",
      "votes": 3,
      "replies": [
        {
          "id": 815599,
          "author_name": "pawan verma",
          "author_url": "",
          "post_date": "2020-04-21T17:06:08.080000",
          "content": "<p>Thanks! Will surely look .</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 820277,
      "author_name": "Chirag",
      "author_url": "",
      "post_date": "2020-04-25T09:42:51.003000",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a>  I got the same error as above but I don't want to do data augmentation but when I try to load the images using imagedatagenrator and try to use TPU I can't do it and getting the same error. Please help</p>",
      "votes": 1,
      "replies": [
        {
          "id": 823306,
          "author_name": "Jesse Mostipak",
          "author_url": "",
          "post_date": "2020-04-27T14:51:57.160000",
          "content": "<p>it's difficult to tell what's happening without seeing your code, but I can recommend following the <a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/\">Getting Started notebook for this competition</a> - everything in here works, and this notebook is a great way to get up and running with TPUs and the Flower Classification dataset.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 823692,
          "author_name": "Martin Görner",
          "author_url": "",
          "post_date": "2020-04-27T20:07:51.537000",
          "content": "<p>The ImageDataGenerator utility from Keras will not work on TPUs. Load your images normally through the tf.data.Dataset API as in the <a href=\"https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu/\">TPU starter notebook</a>.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 828948,
      "author_name": "Chirag",
      "author_url": "",
      "post_date": "2020-05-01T12:04:48.010000",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a> Okk if the notebook doesn't open (try copy and edit option then you can see full code), but can you suggest me a way where I can load 100000 images normal RGB format and train that model on TPU.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 825747,
      "author_name": "Chirag",
      "author_url": "",
      "post_date": "2020-04-29T08:07:08.233000",
      "content": "<p><a href=\"/jessemostipak\">@jessemostipak</a> <a href=\"/mgornergoogle\">@mgornergoogle</a>  As you ask here is my notebook where I want to train my model with TPU.\nPlease do whatever you want to but help me so that I can train my model with TPU.\n<a href=\"https://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251\">https://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251</a></p>",
      "votes": 0,
      "replies": [
        {
          "id": 828010,
          "author_name": "Jesse Mostipak",
          "author_url": "",
          "post_date": "2020-04-30T17:47:51.497000",
          "content": "<p>thanks for sharing the notebook! 3unfortunately when I try to open it it freezes and I can't see anything beyond the first code block. as Martin mentioned in an earlier reply, do make sure that you're loading images through the tf.data.Dataset API!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 812736,
      "author_name": "Kurian Benoy",
      "author_url": "",
      "post_date": "2020-04-19T02:59:57.827000",
      "content": "<p><a href=\"/pawanverma\">@pawanverma</a> did you mean keras ImageGenerator?</p>\n\n<p>Augmentation libraries are not by default supported in TPU</p>",
      "votes": 0,
      "replies": [
        {
          "id": 812980,
          "author_name": "pawan verma",
          "author_url": "",
          "post_date": "2020-04-19T09:36:13.813000",
          "content": "<p>Yes, i was trying to run keras ImageGenerator. Any other method to generate on the fly augmentation</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 832307,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-05-04T03:27:36.403000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "815583": "@cdeotte has created two excellent notebooks for using augmentations with TPUs that should help get you started!\n- [How To: Rotation Augmentation](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132191)\n- [How To: CutMix MixUP](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/132935)",
    "812581": "Hi, i am trying to augment images using ImageGenerator. However, fit_generator method is  throwing error on TPU.\n```\nNotFoundError: {{function_node __inference_train_function_662461}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n\t.  Registered:  ",
    "820277": "@jessemostipak  I got the same error as above but I don't want to do data augmentation but when I try to load the images using imagedatagenrator and try to use TPU I can't do it and getting the same error. Please help",
    "828948": "@jessemostipak Okk if the notebook doesn't open (try copy and edit option then you can see full code), but can you suggest me a way where I can load 100000 images normal RGB format and train that model on TPU.",
    "825747": "@jessemostipak @mgornergoogle  As you ask here is my notebook where I want to train my model with TPU.\nPlease do whatever you want to but help me so that I can train my model with TPU.\nhttps://www.kaggle.com/chirag003/video-classification-normal-tpu/edit/run/30353251",
    "812736": "@pawanverma did you mean keras ImageGenerator?\n\nAugmentation libraries are not by default supported in TPU",
    "832307": ""
  }
}