{
  "id": 143801,
  "title": "About Keras VS Pytorch",
  "url": "/competitions/flower-classification-with-tpus/discussion/143801",
  "author_name": "",
  "post_date": "2020-04-16T10:22:18.478936200Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi, I'm a newbie of keras, I find when using TPU with keras, it faster 2x than Pytorch XLA.\nDo anyone know the reason ?</p>\n\n<p>In keras, I use tf.dataset and fit()\nIn pytorch, I use dataset and epoch training.</p>",
  "messages": [
    {
      "id": "809602",
      "postDate": "04/16/2020 10:22:18",
      "content": "<p>Hi, I'm a newbie of keras, I find when using TPU with keras, it faster 2x than Pytorch XLA.\nDo anyone know the reason ?</p>\n\n<p>In keras, I use tf.dataset and fit()\nIn pytorch, I use dataset and epoch training.</p>",
      "rawMarkdown": "Hi, I'm a newbie of keras, I find when using TPU with keras, it faster 2x than Pytorch XLA.\nDo anyone know the reason ?\n\nIn keras, I use tf.dataset and fit()\nIn pytorch, I use dataset and epoch training.",
      "votes": null
    },
    {
      "id": "811577",
      "postDate": "04/18/2020 04:56:01",
      "content": "<p>When using PyTorch, you can train 8 folds simultaneously. That speeds up PyTorch. An example notebook is <a href=\"https://www.kaggle.com/abhishek/super-duper-fast-pytorch-tpu-kernel\">here</a></p>",
      "rawMarkdown": "When using PyTorch, you can train 8 folds simultaneously. That speeds up PyTorch. An example notebook is [here][1]\n\n[1]: https://www.kaggle.com/abhishek/super-duper-fast-pytorch-tpu-kernel",
      "votes": null
    },
    {
      "id": "818518",
      "postDate": "04/24/2020 00:22:13",
      "content": "<p>For tf, we use the tfrecord files to cache and read the image datas.  It is very fast for data processing. <br>\nFor pytorch, most of us do no use the tfrecord files to cache and read the image datas. So it is slower than tf for data processing.  Since TPU is very very fast,  it always waits for the completion of data processing.\nHence we always see the bigger TPU idle percent for pytorch kernel.  </p>",
      "rawMarkdown": "For tf, we use the tfrecord files to cache and read the image datas.  It is very fast for data processing. <br>\nFor pytorch, most of us do no use the tfrecord files to cache and read the image datas. So it is slower than tf for data processing.  Since TPU is very very fast,  it always waits for the completion of data processing.\nHence we always see the bigger TPU idle percent for pytorch kernel.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 811577,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "04/18/2020 04:56:01",
      "content": "<p>When using PyTorch, you can train 8 folds simultaneously. That speeds up PyTorch. An example notebook is <a href=\"https://www.kaggle.com/abhishek/super-duper-fast-pytorch-tpu-kernel\">here</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 818518,
      "author_name": "qinhui1999",
      "author_url": "",
      "post_date": "04/24/2020 00:22:13",
      "content": "<p>For tf, we use the tfrecord files to cache and read the image datas.  It is very fast for data processing. <br>\nFor pytorch, most of us do no use the tfrecord files to cache and read the image datas. So it is slower than tf for data processing.  Since TPU is very very fast,  it always waits for the completion of data processing.\nHence we always see the bigger TPU idle percent for pytorch kernel.  </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "809602": "Hi, I'm a newbie of keras, I find when using TPU with keras, it faster 2x than Pytorch XLA.\nDo anyone know the reason ?\n\nIn keras, I use tf.dataset and fit()\nIn pytorch, I use dataset and epoch training.",
    "811577": "When using PyTorch, you can train 8 folds simultaneously. That speeds up PyTorch. An example notebook is [here][1]\n\n[1]: https://www.kaggle.com/abhishek/super-duper-fast-pytorch-tpu-kernel",
    "818518": "For tf, we use the tfrecord files to cache and read the image datas.  It is very fast for data processing. <br>\nFor pytorch, most of us do no use the tfrecord files to cache and read the image datas. So it is slower than tf for data processing.  Since TPU is very very fast,  it always waits for the completion of data processing.\nHence we always see the bigger TPU idle percent for pytorch kernel."
  },
  "source": "meta"
}