{
  "id": 204641,
  "title": "ImageDataGenerator Not Compatible with TPUs?",
  "url": "/competitions/ranzcr-clip-catheter-line-classification/discussion/204641",
  "author_name": "Andy",
  "post_date": "2020-12-16T05:56:42.509000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I am using <code>tf.keras.preprocessing.image.ImageDataGenerator</code>, however, it rasies an error when I run the code:<br>\n<code>NotFoundError: {{function_node __inference_train_function_345637}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n      Registered:  &lt;no registered kernels&gt;\n     [[PyFunc]]\n     [[MultiDeviceIteratorGetNextFromShard]]\n     [[RemoteCall]]\n     [[IteratorGetNextAsOptional]]</code></p>\n<p>I have searched around the web, and it seems like the problem is because I am using <code>ImageDataGenerator</code>. Anyone experiencing the same problem? Is there a solution for it? This works on both CPU and GPU.</p>",
  "messages": [
    {
      "id": 1115247,
      "postDate": "2020-12-16T05:56:42.510Z",
      "content": "<p>I am using <code>tf.keras.preprocessing.image.ImageDataGenerator</code>, however, it rasies an error when I run the code:<br>\n<code>NotFoundError: {{function_node __inference_train_function_345637}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n      Registered:  &lt;no registered kernels&gt;\n     [[PyFunc]]\n     [[MultiDeviceIteratorGetNextFromShard]]\n     [[RemoteCall]]\n     [[IteratorGetNextAsOptional]]</code></p>\n<p>I have searched around the web, and it seems like the problem is because I am using <code>ImageDataGenerator</code>. Anyone experiencing the same problem? Is there a solution for it? This works on both CPU and GPU.</p>",
      "rawMarkdown": "I am using `tf.keras.preprocessing.image.ImageDataGenerator`, however, it rasies an error when I run the code:\n`NotFoundError: {{function_node __inference_train_function_345637}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n\t  Registered:  <no registered kernels>\n\t [[PyFunc]]\n\t [[MultiDeviceIteratorGetNextFromShard]]\n\t [[RemoteCall]]\n\t [[IteratorGetNextAsOptional]]`\n\nI have searched around the web, and it seems like the problem is because I am using `ImageDataGenerator`. Anyone experiencing the same problem? Is there a solution for it? This works on both CPU and GPU."
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1115247": "I am using `tf.keras.preprocessing.image.ImageDataGenerator`, however, it rasies an error when I run the code:\n`NotFoundError: {{function_node __inference_train_function_345637}} No registered 'PyFunc' OpKernel for 'CPU' devices compatible with node {{node PyFunc}}\n\t  Registered:  <no registered kernels>\n\t [[PyFunc]]\n\t [[MultiDeviceIteratorGetNextFromShard]]\n\t [[RemoteCall]]\n\t [[IteratorGetNextAsOptional]]`\n\nI have searched around the web, and it seems like the problem is because I am using `ImageDataGenerator`. Anyone experiencing the same problem? Is there a solution for it? This works on both CPU and GPU."
  }
}