{
  "id": 224005,
  "title": "Keeping interactive session live for 40+ mins",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/224005",
  "author_name": "AnkurSingh",
  "post_date": "2021-03-06T11:16:57.794000",
  "votes": 3,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Every week, kaggle provide free GPU. But it's not very useful in interactive mode. Even smaller models take couple of hours to train. </p>\n<p>After many crashed sessions (just because I was away for 40 mins), I decided to do something about it. And I found the following trick. </p>\n<h3>Steps:</h3>\n<ol>\n<li>Right click on the \"Add Cell\" button at the top left corner, and then select \"inspect element\".</li>\n<li>Next, Right click on the element, select \"copy\", and then \"copy Js path\".</li>\n</ol>\n<p>Here is an image to help you navigate better. </p>\n<p><img src=\"https://i.imgur.com/D6s9owZ.jpg\" alt=\"copy Js path\"></p>\n<p>Next, open \"Console\" and paste the following code.</p>\n<pre><code>const interval = setInterval(function() {\n      &lt;replace this with your JS Path, that you copied in step 2&gt;.click()\n}, 1000*60*5);\n</code></pre>\n<p>In my case, after pasting the JS path, the query look like this. </p>\n<pre><code>const interval = setInterval(function() {\n   document.querySelector(\"#site-content &gt; div.AppView-sc-16eb2j.iTRCn &gt; div.App_Body-sc-16c8j4p.hxOBfv &gt; div.Layout_Body-sc-6piylv.bXAYPy &gt; div &gt; div &gt; div &gt; div.ToolbarContainer_Body-sc-2h8iu7.crqUTA &gt; div.ToolbarActionsLeft_Body-sc-gd13f.fipPkk &gt; button:nth-child(1)\").click()\n }, 1000*5);\n</code></pre>\n<p>The above code snippet will press the \"Add cell\" button every 5 minute. This will make it look like you are still editing the code, hence preventing your session from stopping after 40 minutes.</p>\n<p>and to stop the script, you can simply run the below script in the console</p>\n<pre><code>clearInterval(interval);\n</code></pre>\n<p>Hope this trick was helpful, Cheers!</p>",
  "messages": [
    {
      "id": 1228425,
      "postDate": "2021-03-06T11:16:57.793Z",
      "content": "<p>Every week, kaggle provide free GPU. But it's not very useful in interactive mode. Even smaller models take couple of hours to train. </p>\n<p>After many crashed sessions (just because I was away for 40 mins), I decided to do something about it. And I found the following trick. </p>\n<h3>Steps:</h3>\n<ol>\n<li>Right click on the \"Add Cell\" button at the top left corner, and then select \"inspect element\".</li>\n<li>Next, Right click on the element, select \"copy\", and then \"copy Js path\".</li>\n</ol>\n<p>Here is an image to help you navigate better. </p>\n<p><img src=\"https://i.imgur.com/D6s9owZ.jpg\" alt=\"copy Js path\"></p>\n<p>Next, open \"Console\" and paste the following code.</p>\n<pre><code>const interval = setInterval(function() {\n      &lt;replace this with your JS Path, that you copied in step 2&gt;.click()\n}, 1000*60*5);\n</code></pre>\n<p>In my case, after pasting the JS path, the query look like this. </p>\n<pre><code>const interval = setInterval(function() {\n   document.querySelector(\"#site-content &gt; div.AppView-sc-16eb2j.iTRCn &gt; div.App_Body-sc-16c8j4p.hxOBfv &gt; div.Layout_Body-sc-6piylv.bXAYPy &gt; div &gt; div &gt; div &gt; div.ToolbarContainer_Body-sc-2h8iu7.crqUTA &gt; div.ToolbarActionsLeft_Body-sc-gd13f.fipPkk &gt; button:nth-child(1)\").click()\n }, 1000*5);\n</code></pre>\n<p>The above code snippet will press the \"Add cell\" button every 5 minute. This will make it look like you are still editing the code, hence preventing your session from stopping after 40 minutes.</p>\n<p>and to stop the script, you can simply run the below script in the console</p>\n<pre><code>clearInterval(interval);\n</code></pre>\n<p>Hope this trick was helpful, Cheers!</p>",
      "rawMarkdown": "Every week, kaggle provide free GPU. But it's not very useful in interactive mode. Even smaller models take couple of hours to train. \n\nAfter many crashed sessions (just because I was away for 40 mins), I decided to do something about it. And I found the following trick. \n\n### Steps:\n1. Right click on the \"Add Cell\" button at the top left corner, and then select \"inspect element\".\n2. Next, Right click on the element, select \"copy\", and then \"copy Js path\".\n\nHere is an image to help you navigate better. \n\n![copy Js path](https://i.imgur.com/D6s9owZ.jpg)\n\nNext, open \"Console\" and paste the following code.\n\n```javascript\nconst interval = setInterval(function() {\n      <replace this with your JS Path, that you copied in step 2>.click()\n}, 1000*60*5);\n```\n\nIn my case, after pasting the JS path, the query look like this. \n\n```javascript\nconst interval = setInterval(function() {\n   document.querySelector(\"#site-content > div.AppView-sc-16eb2j.iTRCn > div.App_Body-sc-16c8j4p.hxOBfv > div.Layout_Body-sc-6piylv.bXAYPy > div > div > div > div.ToolbarContainer_Body-sc-2h8iu7.crqUTA > div.ToolbarActionsLeft_Body-sc-gd13f.fipPkk > button:nth-child(1)\").click()\n }, 1000*5);\n```\n\nThe above code snippet will press the \"Add cell\" button every 5 minute. This will make it look like you are still editing the code, hence preventing your session from stopping after 40 minutes.\n\nand to stop the script, you can simply run the below script in the console\n\n```javascript\nclearInterval(interval);\n```\n\nHope this trick was helpful, Cheers!",
      "votes": 3
    },
    {
      "id": 1228686,
      "postDate": "2021-03-06T16:40:48Z",
      "content": "<p>This is super cool!</p>\n<p>Might I ask why you wouldn't prefer to run with the Save/Commit (Run All) functionality?</p>",
      "rawMarkdown": "This is super cool!\n\nMight I ask why you wouldn't prefer to run with the Save/Commit (Run All) functionality?"
    }
  ],
  "comments": [
    {
      "id": 1228686,
      "author_name": "Darien Schettler",
      "author_url": "",
      "post_date": "2021-03-06T16:40:48",
      "content": "<p>This is super cool!</p>\n<p>Might I ask why you wouldn't prefer to run with the Save/Commit (Run All) functionality?</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1228425": "Every week, kaggle provide free GPU. But it's not very useful in interactive mode. Even smaller models take couple of hours to train. \n\nAfter many crashed sessions (just because I was away for 40 mins), I decided to do something about it. And I found the following trick. \n\n### Steps:\n1. Right click on the \"Add Cell\" button at the top left corner, and then select \"inspect element\".\n2. Next, Right click on the element, select \"copy\", and then \"copy Js path\".\n\nHere is an image to help you navigate better. \n\n![copy Js path](https://i.imgur.com/D6s9owZ.jpg)\n\nNext, open \"Console\" and paste the following code.\n\n```javascript\nconst interval = setInterval(function() {\n      <replace this with your JS Path, that you copied in step 2>.click()\n}, 1000*60*5);\n```\n\nIn my case, after pasting the JS path, the query look like this. \n\n```javascript\nconst interval = setInterval(function() {\n   document.querySelector(\"#site-content > div.AppView-sc-16eb2j.iTRCn > div.App_Body-sc-16c8j4p.hxOBfv > div.Layout_Body-sc-6piylv.bXAYPy > div > div > div > div.ToolbarContainer_Body-sc-2h8iu7.crqUTA > div.ToolbarActionsLeft_Body-sc-gd13f.fipPkk > button:nth-child(1)\").click()\n }, 1000*5);\n```\n\nThe above code snippet will press the \"Add cell\" button every 5 minute. This will make it look like you are still editing the code, hence preventing your session from stopping after 40 minutes.\n\nand to stop the script, you can simply run the below script in the console\n\n```javascript\nclearInterval(interval);\n```\n\nHope this trick was helpful, Cheers!",
    "1228686": "This is super cool!\n\nMight I ask why you wouldn't prefer to run with the Save/Commit (Run All) functionality?"
  }
}