{
  "id": 156438,
  "title": "I find an amazing thing that how to solve OOM on TPU because of cache.",
  "url": "/competitions/jigsaw-multilingual-toxic-comment-classification/discussion/156438",
  "author_name": "",
  "post_date": "2020-06-06T04:46:37.114307400Z",
  "votes": 9,
  "comment_count": 2,
  "views": 0,
  "content": "<p>When I performed 5-fold cv on TPU and went for the second fold, I always got 'resourceexhaustederror', I hate that.\nHere is a solution in tf.</p>\n\n<p>tf.keras.backend.clear_session()\ntf.tpu.experimental.shutdown_tpu_system()\ntf.tpu.experimental.initialize_tpu_system()</p>\n\n<p>It can clean all the cache on tpu.</p>",
  "messages": [
    {
      "id": "875680",
      "postDate": "06/06/2020 04:46:37",
      "content": "<p>When I performed 5-fold cv on TPU and went for the second fold, I always got 'resourceexhaustederror', I hate that.\nHere is a solution in tf.</p>\n\n<p>tf.keras.backend.clear_session()\ntf.tpu.experimental.shutdown_tpu_system()\ntf.tpu.experimental.initialize_tpu_system()</p>\n\n<p>It can clean all the cache on tpu.</p>",
      "rawMarkdown": "When I performed 5-fold cv on TPU and went for the second fold, I always got 'resourceexhaustederror', I hate that.\nHere is a solution in tf.\n\ntf.keras.backend.clear_session()\ntf.tpu.experimental.shutdown_tpu_system()\ntf.tpu.experimental.initialize_tpu_system()\n\nIt can clean all the cache on tpu.",
      "votes": null
    },
    {
      "id": "875690",
      "postDate": "06/06/2020 05:07:38",
      "content": "<p>it was very helpful.</p>",
      "rawMarkdown": "it was very helpful.",
      "votes": null
    },
    {
      "id": "889150",
      "postDate": "06/16/2020 19:52:29",
      "content": "<p><code>tf.tpu.experimental.initialize_tpu_system()</code> is brutal enough for wiping pout the TPU memory :-)</p>",
      "rawMarkdown": "`tf.tpu.experimental.initialize_tpu_system()` is brutal enough for wiping pout the TPU memory :-)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 875690,
      "author_name": "meenakshikhaitan",
      "author_url": "",
      "post_date": "06/06/2020 05:07:38",
      "content": "<p>it was very helpful.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 889150,
      "author_name": "mgorner",
      "author_url": "",
      "post_date": "06/16/2020 19:52:29",
      "content": "<p><code>tf.tpu.experimental.initialize_tpu_system()</code> is brutal enough for wiping pout the TPU memory :-)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "875680": "When I performed 5-fold cv on TPU and went for the second fold, I always got 'resourceexhaustederror', I hate that.\nHere is a solution in tf.\n\ntf.keras.backend.clear_session()\ntf.tpu.experimental.shutdown_tpu_system()\ntf.tpu.experimental.initialize_tpu_system()\n\nIt can clean all the cache on tpu.",
    "875690": "it was very helpful.",
    "889150": "`tf.tpu.experimental.initialize_tpu_system()` is brutal enough for wiping pout the TPU memory :-)"
  },
  "source": "meta"
}