{
  "id": 386143,
  "title": "Can Training/Inference in different notebook?",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/386143",
  "author_name": "Hao-Lun Sun",
  "post_date": "2023-02-11T10:55:23.841000",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Dear every Kaggler,<br>\nIt is a non-technical problem. I want to know whether I can separate the training and testing process in different notebook or not?<br>\nFor example, can I only submit the notebook which includes only my trained model and testing process in it? (w/o any training process in this notebook)? </p>\n<p>Many thanks!</p>",
  "messages": [
    {
      "id": 2140204,
      "postDate": "2023-02-11T14:43:35.520Z",
      "content": "<p>Yes you can.</p>",
      "rawMarkdown": "Yes you can.",
      "votes": 1,
      "replies": [
        {
          "id": 2140228,
          "postDate": "2023-02-11T15:11:03.977Z",
          "content": "<p>Thanks for your answering!</p>",
          "rawMarkdown": "Thanks for your answering!\n"
        }
      ]
    },
    {
      "id": 2139997,
      "postDate": "2023-02-11T11:01:34.870Z",
      "content": "<p>yes, you don't need training code for submission, only the inference</p>",
      "rawMarkdown": "yes, you don't need training code for submission, only the inference",
      "votes": 1,
      "replies": [
        {
          "id": 2140004,
          "postDate": "2023-02-11T11:10:22.660Z",
          "content": "<p>Wow! Really thanks for your help!</p>",
          "rawMarkdown": "Wow! Really thanks for your help!"
        }
      ]
    },
    {
      "id": 2139994,
      "postDate": "2023-02-11T10:55:23.843Z",
      "content": "<p>Dear every Kaggler,<br>\nIt is a non-technical problem. I want to know whether I can separate the training and testing process in different notebook or not?<br>\nFor example, can I only submit the notebook which includes only my trained model and testing process in it? (w/o any training process in this notebook)? </p>\n<p>Many thanks!</p>",
      "rawMarkdown": "Dear every Kaggler,\nIt is a non-technical problem. I want to know whether I can separate the training and testing process in different notebook or not?\nFor example, can I only submit the notebook which includes only my trained model and testing process in it? (w/o any training process in this notebook)? \n\nMany thanks!",
      "votes": 1
    },
    {
      "id": 2149986,
      "postDate": "2023-02-18T20:56:38.953Z",
      "content": "<h3># Yes,</h3>\n<p>In the training notebook save your weights (if using pytorch ---use<br>\n <strong>torch.save(model.state_dict(), PATH)</strong> to save the wights of the model trained.</p>\n<p>and </p>\n<p>in the inference notebook import the same wights and do the inference<br>\n<strong>model.load_state_dict(torch.load(PATH))</strong></p>",
      "rawMarkdown": "### # Yes,\n\nIn the training notebook save your weights (if using pytorch ---use\n **torch.save(model.state_dict(), PATH)** to save the wights of the model trained.\n\nand \n\nin the inference notebook import the same wights and do the inference\n**model.load_state_dict(torch.load(PATH))**"
    }
  ],
  "comments": [
    {
      "id": 2140204,
      "author_name": "Sandy",
      "author_url": "",
      "post_date": "2023-02-11T14:43:35.520000",
      "content": "<p>Yes you can.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2140228,
          "author_name": "Hao-Lun Sun",
          "author_url": "",
          "post_date": "2023-02-11T15:11:03.977000",
          "content": "<p>Thanks for your answering!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2139997,
      "author_name": "FlaviuPaul",
      "author_url": "",
      "post_date": "2023-02-11T11:01:34.870000",
      "content": "<p>yes, you don't need training code for submission, only the inference</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2140004,
          "author_name": "Hao-Lun Sun",
          "author_url": "",
          "post_date": "2023-02-11T11:10:22.660000",
          "content": "<p>Wow! Really thanks for your help!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2149986,
      "author_name": "Vishak K Bhat",
      "author_url": "",
      "post_date": "2023-02-18T20:56:38.953000",
      "content": "<h3># Yes,</h3>\n<p>In the training notebook save your weights (if using pytorch ---use<br>\n <strong>torch.save(model.state_dict(), PATH)</strong> to save the wights of the model trained.</p>\n<p>and </p>\n<p>in the inference notebook import the same wights and do the inference<br>\n<strong>model.load_state_dict(torch.load(PATH))</strong></p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2140204": "Yes you can.",
    "2139997": "yes, you don't need training code for submission, only the inference",
    "2139994": "Dear every Kaggler,\nIt is a non-technical problem. I want to know whether I can separate the training and testing process in different notebook or not?\nFor example, can I only submit the notebook which includes only my trained model and testing process in it? (w/o any training process in this notebook)? \n\nMany thanks!",
    "2149986": "### # Yes,\n\nIn the training notebook save your weights (if using pytorch ---use\n **torch.save(model.state_dict(), PATH)** to save the wights of the model trained.\n\nand \n\nin the inference notebook import the same wights and do the inference\n**model.load_state_dict(torch.load(PATH))**"
  }
}