{
  "id": 249112,
  "title": "Thoughts on converting Kaggle's notebooks to local scripts",
  "url": "/competitions/siim-covid19-detection/discussion/249112",
  "author_name": "",
  "post_date": "2021-06-26T16:12:49.374753500Z",
  "votes": null,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Dear all,<br>\nI'm newbie and I'm wondering how you train models for competitions. I found public code and all of them are presented in the notebook format and they run directly on Kaggle platform. For some reasons (Kaggle's GPU time limits, etc), I prefer using my local machine to train models. So I convert these notebooks to normal .py scripts and run on my own machine. <br>\nI think that online notebook is just for competitions that require Code/Notebook and only inference time is presented, not the notebook for training.<br>\nWhat's your fashion of doing these?<br>\nThanks,</p>",
  "messages": [
    {
      "id": "1366290",
      "postDate": "06/26/2021 16:12:49",
      "content": "<p>Dear all,<br>\nI'm newbie and I'm wondering how you train models for competitions. I found public code and all of them are presented in the notebook format and they run directly on Kaggle platform. For some reasons (Kaggle's GPU time limits, etc), I prefer using my local machine to train models. So I convert these notebooks to normal .py scripts and run on my own machine. <br>\nI think that online notebook is just for competitions that require Code/Notebook and only inference time is presented, not the notebook for training.<br>\nWhat's your fashion of doing these?<br>\nThanks,</p>",
      "rawMarkdown": "Dear all,\nI'm newbie and I'm wondering how you train models for competitions. I found public code and all of them are presented in the notebook format and they run directly on Kaggle platform. For some reasons (Kaggle's GPU time limits, etc), I prefer using my local machine to train models. So I convert these notebooks to normal .py scripts and run on my own machine. \nI think that online notebook is just for competitions that require Code/Notebook and only inference time is presented, not the notebook for training.\nWhat's your fashion of doing these?\nThanks,",
      "votes": null
    },
    {
      "id": "1366296",
      "postDate": "06/26/2021 16:20:58",
      "content": "<p>By the way, it's very inconvenient in case I want to share my .py scripts</p>",
      "rawMarkdown": "By the way, it's very inconvenient in case I want to share my .py scripts",
      "votes": null
    },
    {
      "id": "1366316",
      "postDate": "06/26/2021 16:47:21",
      "content": "<p>You could use <code>jupyter nbconvert nb.ipynb --to script</code> to convert to python scripts, where nb is the notebook name and vice versa.. see --help for the exact syntax</p>",
      "rawMarkdown": "You could use `jupyter nbconvert nb.ipynb --to script` to convert to python scripts, where nb is the notebook name and vice versa.. see --help for the exact syntax",
      "votes": null
    },
    {
      "id": "1366319",
      "postDate": "06/26/2021 16:50:20",
      "content": "<p>Is this the preferred way to work on both Kaggle and local machine?</p>",
      "rawMarkdown": "Is this the preferred way to work on both Kaggle and local machine?",
      "votes": null
    },
    {
      "id": "1366340",
      "postDate": "06/26/2021 17:13:19",
      "content": "<p>Yes most people train locally (or colab) and make inference through kaggle nbs (by uploading trained weights etc) </p>",
      "rawMarkdown": "Yes most people train locally (or colab) and make inference through kaggle nbs (by uploading trained weights etc)",
      "votes": null
    },
    {
      "id": "1373637",
      "postDate": "07/02/2021 16:49:27",
      "content": "<p>1) write the code in order to the python file as in notebook.<br>\n2)<br>\n    pip install jupyterlab<br>\n    in terminal:<br>\n         jupyter-lab<br>\n<a href=\"https://jupyter.org\" target=\"_blank\">https://jupyter.org</a></p>",
      "rawMarkdown": "1) write the code in order to the python file as in notebook.\n2)\n    pip install jupyterlab\n    in terminal:\n         jupyter-lab\nhttps://jupyter.org",
      "votes": null
    },
    {
      "id": "1374025",
      "postDate": "07/03/2021 00:11:14",
      "content": "<p>thanks, I will try this</p>",
      "rawMarkdown": "thanks, I will try this",
      "votes": null
    },
    {
      "id": "1378179",
      "postDate": "07/06/2021 11:03:16",
      "content": "<p>yes. that's what I am doing as well. Working thru training the model in colab. </p>",
      "rawMarkdown": "yes. that's what I am doing as well. Working thru training the model in colab.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1366296,
      "author_name": "pvtien96",
      "author_url": "",
      "post_date": "06/26/2021 16:20:58",
      "content": "<p>By the way, it's very inconvenient in case I want to share my .py scripts</p>",
      "votes": null,
      "replies": [
        {
          "id": 1366316,
          "author_name": "imeintanis",
          "author_url": "",
          "post_date": "06/26/2021 16:47:21",
          "content": "<p>You could use <code>jupyter nbconvert nb.ipynb --to script</code> to convert to python scripts, where nb is the notebook name and vice versa.. see --help for the exact syntax</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1366319,
          "author_name": "pvtien96",
          "author_url": "",
          "post_date": "06/26/2021 16:50:20",
          "content": "<p>Is this the preferred way to work on both Kaggle and local machine?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1366340,
          "author_name": "imeintanis",
          "author_url": "",
          "post_date": "06/26/2021 17:13:19",
          "content": "<p>Yes most people train locally (or colab) and make inference through kaggle nbs (by uploading trained weights etc) </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1378179,
          "author_name": "hawkeat",
          "author_url": "",
          "post_date": "07/06/2021 11:03:16",
          "content": "<p>yes. that's what I am doing as well. Working thru training the model in colab. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1373637,
      "author_name": "zaakciiru",
      "author_url": "",
      "post_date": "07/02/2021 16:49:27",
      "content": "<p>1) write the code in order to the python file as in notebook.<br>\n2)<br>\n    pip install jupyterlab<br>\n    in terminal:<br>\n         jupyter-lab<br>\n<a href=\"https://jupyter.org\" target=\"_blank\">https://jupyter.org</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1374025,
          "author_name": "pvtien96",
          "author_url": "",
          "post_date": "07/03/2021 00:11:14",
          "content": "<p>thanks, I will try this</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1366290": "Dear all,\nI'm newbie and I'm wondering how you train models for competitions. I found public code and all of them are presented in the notebook format and they run directly on Kaggle platform. For some reasons (Kaggle's GPU time limits, etc), I prefer using my local machine to train models. So I convert these notebooks to normal .py scripts and run on my own machine. \nI think that online notebook is just for competitions that require Code/Notebook and only inference time is presented, not the notebook for training.\nWhat's your fashion of doing these?\nThanks,",
    "1366296": "By the way, it's very inconvenient in case I want to share my .py scripts",
    "1366316": "You could use `jupyter nbconvert nb.ipynb --to script` to convert to python scripts, where nb is the notebook name and vice versa.. see --help for the exact syntax",
    "1366319": "Is this the preferred way to work on both Kaggle and local machine?",
    "1366340": "Yes most people train locally (or colab) and make inference through kaggle nbs (by uploading trained weights etc)",
    "1373637": "1) write the code in order to the python file as in notebook.\n2)\n    pip install jupyterlab\n    in terminal:\n         jupyter-lab\nhttps://jupyter.org",
    "1374025": "thanks, I will try this",
    "1378179": "yes. that's what I am doing as well. Working thru training the model in colab."
  },
  "source": "meta"
}