{
  "id": 120586,
  "title": "How to load existing model and avoid submission error?",
  "url": "/competitions/Kannada-MNIST/discussion/120586",
  "author_name": "",
  "post_date": "2019-12-07T07:22:35.721403500Z",
  "votes": 4,
  "comment_count": 3,
  "views": 0,
  "content": "<pre><code>As I understanding, kaggle will run our total code when committing,  and it run our total code again when we submit the results. \n\nI'm considering about how to save time, because if my model needs 1,000 s to run, I have to wait 2,000 s to get the result in the Leaderboard.  \n\nAnd my method is, build two note books, CodeA and CodeB. The CodeA finish training and prediction when it be committed, and get the outputs.csv  \nNow I input the outputs.csv in the CodeB, and the CodeB main function like this\n</code></pre>\n\n<p><code>submission = pd.read_csv('/kaggle/input/pytorch-kannada-mnist/submission0.csv')\n submission.to_csv('/kaggle/working/submission.csv', index=False)\n submission.head()</code>\n    This kind of CodeB only need 10s to run, so after adding the submit time, we just need extra 20s to get the results in the Leaderboard.</p>\n\n<p>Now the problem is it occur ''Submission Scoring Error' and doesn't show any error details, So it means we can't using other input to get the finial results? </p>\n\n<p>The most important is, are there any other methods to save the time we get our test results?</p>",
  "messages": [
    {
      "id": "689624",
      "postDate": "12/07/2019 07:22:35",
      "content": "<pre><code>As I understanding, kaggle will run our total code when committing,  and it run our total code again when we submit the results. \n\nI'm considering about how to save time, because if my model needs 1,000 s to run, I have to wait 2,000 s to get the result in the Leaderboard.  \n\nAnd my method is, build two note books, CodeA and CodeB. The CodeA finish training and prediction when it be committed, and get the outputs.csv  \nNow I input the outputs.csv in the CodeB, and the CodeB main function like this\n</code></pre>\n\n<p><code>submission = pd.read_csv('/kaggle/input/pytorch-kannada-mnist/submission0.csv')\n submission.to_csv('/kaggle/working/submission.csv', index=False)\n submission.head()</code>\n    This kind of CodeB only need 10s to run, so after adding the submit time, we just need extra 20s to get the results in the Leaderboard.</p>\n\n<p>Now the problem is it occur ''Submission Scoring Error' and doesn't show any error details, So it means we can't using other input to get the finial results? </p>\n\n<p>The most important is, are there any other methods to save the time we get our test results?</p>",
      "rawMarkdown": "As I understanding, kaggle will run our total code when committing,  and it run our total code again when we submit the results. \n\n    I'm considering about how to save time, because if my model needs 1,000 s to run, I have to wait 2,000 s to get the result in the Leaderboard.  \n\n    And my method is, build two note books, CodeA and CodeB. The CodeA finish training and prediction when it be committed, and get the outputs.csv  \n    Now I input the outputs.csv in the CodeB, and the CodeB main function like this\n`submission = pd.read_csv('/kaggle/input/pytorch-kannada-mnist/submission0.csv')\n submission.to_csv('/kaggle/working/submission.csv', index=False)\n submission.head()`\n    This kind of CodeB only need 10s to run, so after adding the submit time, we just need extra 20s to get the results in the Leaderboard.\n\n   Now the problem is it occur ''Submission Scoring Error' and doesn't show any error details, So it means we can't using other input to get the finial results? \n\n   The most important is, are there any other methods to save the time we get our test results?",
      "votes": null
    },
    {
      "id": "689646",
      "postDate": "12/07/2019 08:08:40",
      "content": "<p>The question has been solved.</p>",
      "rawMarkdown": "The question has been solved.",
      "votes": null
    },
    {
      "id": "690094",
      "postDate": "12/08/2019 00:08:17",
      "content": "<p>How did you resolve this?</p>\n\n<p>I'm trying to avoid the \"doubling\" of my GPU resources since it must run both publicly then privately, and this is effectively the same problem you're trying to solve (though I'm more worried about draining my resources, not the actual time it takes 😂).</p>\n\n<p>I found this thread <a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94908\">https://www.kaggle.com/c/instant-gratification/discussion/94908</a> , and I'm trying to piece it together for how to incorporate it here for this competition. I'm not sure what the sizes of the public and private test sets, and I'm not sure if that comes into play for the stopping for loops. Any ideas?</p>",
      "rawMarkdown": "How did you resolve this?\n\nI'm trying to avoid the \"doubling\" of my GPU resources since it must run both publicly then privately, and this is effectively the same problem you're trying to solve (though I'm more worried about draining my resources, not the actual time it takes 😂).\n\nI found this thread https://www.kaggle.com/c/instant-gratification/discussion/94908 , and I'm trying to piece it together for how to incorporate it here for this competition. I'm not sure what the sizes of the public and private test sets, and I'm not sure if that comes into play for the stopping for loops. Any ideas?",
      "votes": null
    },
    {
      "id": "690146",
      "postDate": "12/08/2019 03:39:55",
      "content": "<p>Hi, </p>\n\n<p>I read the thread you attached, I think no need to create some error on purpose to solve this** in small test dataset. **</p>\n\n<p>There are two ways, one is using two kernels, one is using one kernel.</p>\n\n<p>For two kernels, \n1. you can use the 'train' kernel to finish your training and save the weight information in kaggle/working/weight.xx.\n2. in your 'test' kernel, add the output of the 'train kernel' as an input. load the weight in the code and start test, create submissions.\n3. submit the submission created by 'test' kernel.\nTotally, It will cost 'train time' + 2 *'test time', in this competition, the test time is about 30s. for me, the training time is 800s. so 700s is saved.</p>\n\n<p>For one kernel,\nthe method above can also work in one kernel, also just add the output of this kernel as an input(you can find it in 'add data').\nin this case you need to set some parameters to control run train or test  only one time.\nand the output file will be reset when you press 'commit' and 'submit', so you need to save the weight file again when you test.</p>\n\n<p>if the test time is very long, I think the method in that thread is better. However, maybe the method can be changed like this:\n1. add the output of the current kernel as an input.\n2. commit it and do nothing, you can make some error in the first line. so now we do not have any output.\n3. create fake submission first, then load 'input/submission.csv'. this line will occur error, because we don't have any output in last commit.\n4. submit the submission, now we have the 'input/submission.csv' because it is created by the last commit. then in the submit, the total code can run successfully.\nThis is  just my temporary idea, I have not tried it.😜 </p>",
      "rawMarkdown": "Hi, \n\nI read the thread you attached, I think no need to create some error on purpose to solve this** in small test dataset. **\n\nThere are two ways, one is using two kernels, one is using one kernel.\n\nFor two kernels, \n1. you can use the 'train' kernel to finish your training and save the weight information in kaggle/working/weight.xx.\n2. in your 'test' kernel, add the output of the 'train kernel' as an input. load the weight in the code and start test, create submissions.\n3. submit the submission created by 'test' kernel.\nTotally, It will cost 'train time' + 2 *'test time', in this competition, the test time is about 30s. for me, the training time is 800s. so 700s is saved.\n\nFor one kernel,\nthe method above can also work in one kernel, also just add the output of this kernel as an input(you can find it in 'add data').\nin this case you need to set some parameters to control run train or test  only one time.\nand the output file will be reset when you press 'commit' and 'submit', so you need to save the weight file again when you test.\n\nif the test time is very long, I think the method in that thread is better. However, maybe the method can be changed like this:\n1. add the output of the current kernel as an input.\n2. commit it and do nothing, you can make some error in the first line. so now we do not have any output.\n3. create fake submission first, then load 'input/submission.csv'. this line will occur error, because we don't have any output in last commit.\n4. submit the submission, now we have the 'input/submission.csv' because it is created by the last commit. then in the submit, the total code can run successfully.\nThis is  just my temporary idea, I have not tried it.😜",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 689646,
      "author_name": "lhy1997",
      "author_url": "",
      "post_date": "12/07/2019 08:08:40",
      "content": "<p>The question has been solved.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 690094,
      "author_name": "egrimley",
      "author_url": "",
      "post_date": "12/08/2019 00:08:17",
      "content": "<p>How did you resolve this?</p>\n\n<p>I'm trying to avoid the \"doubling\" of my GPU resources since it must run both publicly then privately, and this is effectively the same problem you're trying to solve (though I'm more worried about draining my resources, not the actual time it takes 😂).</p>\n\n<p>I found this thread <a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94908\">https://www.kaggle.com/c/instant-gratification/discussion/94908</a> , and I'm trying to piece it together for how to incorporate it here for this competition. I'm not sure what the sizes of the public and private test sets, and I'm not sure if that comes into play for the stopping for loops. Any ideas?</p>",
      "votes": null,
      "replies": [
        {
          "id": 690146,
          "author_name": "lhy1997",
          "author_url": "",
          "post_date": "12/08/2019 03:39:55",
          "content": "<p>Hi, </p>\n\n<p>I read the thread you attached, I think no need to create some error on purpose to solve this** in small test dataset. **</p>\n\n<p>There are two ways, one is using two kernels, one is using one kernel.</p>\n\n<p>For two kernels, \n1. you can use the 'train' kernel to finish your training and save the weight information in kaggle/working/weight.xx.\n2. in your 'test' kernel, add the output of the 'train kernel' as an input. load the weight in the code and start test, create submissions.\n3. submit the submission created by 'test' kernel.\nTotally, It will cost 'train time' + 2 *'test time', in this competition, the test time is about 30s. for me, the training time is 800s. so 700s is saved.</p>\n\n<p>For one kernel,\nthe method above can also work in one kernel, also just add the output of this kernel as an input(you can find it in 'add data').\nin this case you need to set some parameters to control run train or test  only one time.\nand the output file will be reset when you press 'commit' and 'submit', so you need to save the weight file again when you test.</p>\n\n<p>if the test time is very long, I think the method in that thread is better. However, maybe the method can be changed like this:\n1. add the output of the current kernel as an input.\n2. commit it and do nothing, you can make some error in the first line. so now we do not have any output.\n3. create fake submission first, then load 'input/submission.csv'. this line will occur error, because we don't have any output in last commit.\n4. submit the submission, now we have the 'input/submission.csv' because it is created by the last commit. then in the submit, the total code can run successfully.\nThis is  just my temporary idea, I have not tried it.😜 </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "689624": "As I understanding, kaggle will run our total code when committing,  and it run our total code again when we submit the results. \n\n    I'm considering about how to save time, because if my model needs 1,000 s to run, I have to wait 2,000 s to get the result in the Leaderboard.  \n\n    And my method is, build two note books, CodeA and CodeB. The CodeA finish training and prediction when it be committed, and get the outputs.csv  \n    Now I input the outputs.csv in the CodeB, and the CodeB main function like this\n`submission = pd.read_csv('/kaggle/input/pytorch-kannada-mnist/submission0.csv')\n submission.to_csv('/kaggle/working/submission.csv', index=False)\n submission.head()`\n    This kind of CodeB only need 10s to run, so after adding the submit time, we just need extra 20s to get the results in the Leaderboard.\n\n   Now the problem is it occur ''Submission Scoring Error' and doesn't show any error details, So it means we can't using other input to get the finial results? \n\n   The most important is, are there any other methods to save the time we get our test results?",
    "689646": "The question has been solved.",
    "690094": "How did you resolve this?\n\nI'm trying to avoid the \"doubling\" of my GPU resources since it must run both publicly then privately, and this is effectively the same problem you're trying to solve (though I'm more worried about draining my resources, not the actual time it takes 😂).\n\nI found this thread https://www.kaggle.com/c/instant-gratification/discussion/94908 , and I'm trying to piece it together for how to incorporate it here for this competition. I'm not sure what the sizes of the public and private test sets, and I'm not sure if that comes into play for the stopping for loops. Any ideas?",
    "690146": "Hi, \n\nI read the thread you attached, I think no need to create some error on purpose to solve this** in small test dataset. **\n\nThere are two ways, one is using two kernels, one is using one kernel.\n\nFor two kernels, \n1. you can use the 'train' kernel to finish your training and save the weight information in kaggle/working/weight.xx.\n2. in your 'test' kernel, add the output of the 'train kernel' as an input. load the weight in the code and start test, create submissions.\n3. submit the submission created by 'test' kernel.\nTotally, It will cost 'train time' + 2 *'test time', in this competition, the test time is about 30s. for me, the training time is 800s. so 700s is saved.\n\nFor one kernel,\nthe method above can also work in one kernel, also just add the output of this kernel as an input(you can find it in 'add data').\nin this case you need to set some parameters to control run train or test  only one time.\nand the output file will be reset when you press 'commit' and 'submit', so you need to save the weight file again when you test.\n\nif the test time is very long, I think the method in that thread is better. However, maybe the method can be changed like this:\n1. add the output of the current kernel as an input.\n2. commit it and do nothing, you can make some error in the first line. so now we do not have any output.\n3. create fake submission first, then load 'input/submission.csv'. this line will occur error, because we don't have any output in last commit.\n4. submit the submission, now we have the 'input/submission.csv' because it is created by the last commit. then in the submit, the total code can run successfully.\nThis is  just my temporary idea, I have not tried it.😜"
  },
  "source": "meta"
}