{
  "id": 142928,
  "title": "free RAM",
  "url": "/competitions/flower-classification-with-tpus/discussion/142928",
  "author_name": "",
  "post_date": "2020-04-12T22:11:39.034655600Z",
  "votes": 9,
  "comment_count": 1,
  "views": 0,
  "content": "<p>to get some free RAM  you can just save your model </p>\n\n<h1>model.save(\"model.h5\")</h1>\n\n<p>then Clears the default graph stack and resets the global default graph with </p>\n\n<h1>tf.compat.v1.reset_default_graph()</h1>\n\n<h1>del model</h1>\n\n<p>and then call Garbage Collector to collect RAM</p>\n\n<h1>import gc</h1>\n\n<h1>gc.collect()</h1>\n\n<p>then load your model and start with a new one</p>\n\n<h1>model=tf.keras.models.load_model('model.h5')</h1>",
  "messages": [
    {
      "id": "805655",
      "postDate": "04/12/2020 22:11:39",
      "content": "<p>to get some free RAM  you can just save your model </p>\n\n<h1>model.save(\"model.h5\")</h1>\n\n<p>then Clears the default graph stack and resets the global default graph with </p>\n\n<h1>tf.compat.v1.reset_default_graph()</h1>\n\n<h1>del model</h1>\n\n<p>and then call Garbage Collector to collect RAM</p>\n\n<h1>import gc</h1>\n\n<h1>gc.collect()</h1>\n\n<p>then load your model and start with a new one</p>\n\n<h1>model=tf.keras.models.load_model('model.h5')</h1>",
      "rawMarkdown": "to get some free RAM  you can just save your model \n#  model.save(\"model.h5\")\n\nthen Clears the default graph stack and resets the global default graph with \n# tf.compat.v1.reset_default_graph() \n# del model\nand then call Garbage Collector to collect RAM\n# import gc\n# gc.collect()\n\nthen load your model and start with a new one\n# model=tf.keras.models.load_model('model.h5')",
      "votes": null
    },
    {
      "id": "815823",
      "postDate": "04/21/2020 21:36:30",
      "content": "<p>And if it's not enough one can go for memory-efficient optimizers like Adafactor, SM3 and/or enable mixed precision.  </p>",
      "rawMarkdown": "And if it's not enough one can go for memory-efficient optimizers like Adafactor, SM3 and/or enable mixed precision.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 815823,
      "author_name": "szacho",
      "author_url": "",
      "post_date": "04/21/2020 21:36:30",
      "content": "<p>And if it's not enough one can go for memory-efficient optimizers like Adafactor, SM3 and/or enable mixed precision.  </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "805655": "to get some free RAM  you can just save your model \n#  model.save(\"model.h5\")\n\nthen Clears the default graph stack and resets the global default graph with \n# tf.compat.v1.reset_default_graph() \n# del model\nand then call Garbage Collector to collect RAM\n# import gc\n# gc.collect()\n\nthen load your model and start with a new one\n# model=tf.keras.models.load_model('model.h5')",
    "815823": "And if it's not enough one can go for memory-efficient optimizers like Adafactor, SM3 and/or enable mixed precision."
  },
  "source": "meta"
}