{
  "id": 165843,
  "title": "How to train the model on my own computer and submit test results on kaggle?",
  "url": "/competitions/global-wheat-detection/discussion/165843",
  "author_name": "",
  "post_date": "2020-07-11T07:07:42.020688Z",
  "votes": 5,
  "comment_count": 8,
  "views": 0,
  "content": "<p>I have trained the model on my own local GPU device and got weights files.  But how to use the saved weights to infer the test dataset on kaggle notebook? I try to upload weights files to kaggle datasets but failed due to the slow internet. And I also try to upload weights files to github and git clone to notebook, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. I'm going crazy about this problem! How to solve this problem? Thanks a lot!🤝 🤝 🤝 </p>",
  "messages": [
    {
      "id": "923915",
      "postDate": "07/11/2020 07:07:42",
      "content": "<p>I have trained the model on my own local GPU device and got weights files.  But how to use the saved weights to infer the test dataset on kaggle notebook? I try to upload weights files to kaggle datasets but failed due to the slow internet. And I also try to upload weights files to github and git clone to notebook, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. I'm going crazy about this problem! How to solve this problem? Thanks a lot!🤝 🤝 🤝 </p>",
      "rawMarkdown": "I have trained the model on my own local GPU device and got weights files.  But how to use the saved weights to infer the test dataset on kaggle notebook? I try to upload weights files to kaggle datasets but failed due to the slow internet. And I also try to upload weights files to github and git clone to notebook, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. I'm going crazy about this problem! How to solve this problem? Thanks a lot!🤝 🤝 🤝",
      "votes": null
    },
    {
      "id": "924367",
      "postDate": "07/11/2020 11:54:53",
      "content": "<p>You have to upload it as a Kaggle dataset, there's no way around that because your submission kernel cannot have internet.</p>",
      "rawMarkdown": "You have to upload it as a Kaggle dataset, there's no way around that because your submission kernel cannot have internet.",
      "votes": null
    },
    {
      "id": "924468",
      "postDate": "07/11/2020 12:49:16",
      "content": "<p>If the upload is unreliable I guess you could upload 1 weights file at a time. Either load each file into separate datasets or into new versions of the same dataset. This may help a bit?</p>",
      "rawMarkdown": "If the upload is unreliable I guess you could upload 1 weights file at a time. Either load each file into separate datasets or into new versions of the same dataset. This may help a bit?",
      "votes": null
    },
    {
      "id": "924931",
      "postDate": "07/11/2020 18:01:42",
      "content": "<p>If you are having slow internet issue, then you should try kaggle api.\nYou can directly upload your weight files from google drive to a kaggle dataset with this api and it is super fast. You will have it done within few seconds to be specific.\n<a href=\"https://github.com/Kaggle/kaggle-api\">https://github.com/Kaggle/kaggle-api</a> give this a look.</p>",
      "rawMarkdown": "If you are having slow internet issue, then you should try kaggle api.\nYou can directly upload your weight files from google drive to a kaggle dataset with this api and it is super fast. You will have it done within few seconds to be specific.\nhttps://github.com/Kaggle/kaggle-api give this a look.",
      "votes": null
    },
    {
      "id": "927601",
      "postDate": "07/13/2020 14:01:06",
      "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
      "rawMarkdown": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
      "votes": null
    },
    {
      "id": "927602",
      "postDate": "07/13/2020 14:01:29",
      "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
      "rawMarkdown": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
      "votes": null
    },
    {
      "id": "927603",
      "postDate": "07/13/2020 14:01:37",
      "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
      "rawMarkdown": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
      "votes": null
    },
    {
      "id": "927811",
      "postDate": "07/13/2020 15:38:30",
      "content": "<p>I guess you are using yolov5 here.\nYou have to clone the yolov5 repo to your working directory.\nThen use !cp yolov5/models .\nIt will solve your problem.\nIf you are on kaggle use yolov5 as a dataset and import the models directory.</p>",
      "rawMarkdown": "I guess you are using yolov5 here.\nYou have to clone the yolov5 repo to your working directory.\nThen use !cp yolov5/models .\nIt will solve your problem.\nIf you are on kaggle use yolov5 as a dataset and import the models directory.",
      "votes": null
    },
    {
      "id": "938654",
      "postDate": "07/21/2020 16:50:17",
      "content": "<p>Hey! tried uploading on google drive? and download in some kernel with gdown?</p>",
      "rawMarkdown": "Hey! tried uploading on google drive? and download in some kernel with gdown?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 924367,
      "author_name": "matthewmasters",
      "author_url": "",
      "post_date": "07/11/2020 11:54:53",
      "content": "<p>You have to upload it as a Kaggle dataset, there's no way around that because your submission kernel cannot have internet.</p>",
      "votes": null,
      "replies": [
        {
          "id": 927603,
          "author_name": "wuan3076",
          "author_url": "",
          "post_date": "07/13/2020 14:01:37",
          "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 924468,
      "author_name": "datahobbit",
      "author_url": "",
      "post_date": "07/11/2020 12:49:16",
      "content": "<p>If the upload is unreliable I guess you could upload 1 weights file at a time. Either load each file into separate datasets or into new versions of the same dataset. This may help a bit?</p>",
      "votes": null,
      "replies": [
        {
          "id": 927601,
          "author_name": "wuan3076",
          "author_url": "",
          "post_date": "07/13/2020 14:01:06",
          "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 924931,
      "author_name": "zaber666",
      "author_url": "",
      "post_date": "07/11/2020 18:01:42",
      "content": "<p>If you are having slow internet issue, then you should try kaggle api.\nYou can directly upload your weight files from google drive to a kaggle dataset with this api and it is super fast. You will have it done within few seconds to be specific.\n<a href=\"https://github.com/Kaggle/kaggle-api\">https://github.com/Kaggle/kaggle-api</a> give this a look.</p>",
      "votes": null,
      "replies": [
        {
          "id": 927602,
          "author_name": "wuan3076",
          "author_url": "",
          "post_date": "07/13/2020 14:01:29",
          "content": "<p>Thanks a lot! I could upload weight file through github, but it raises an error <code>ModuleNotFoundError: No module named 'models'</code> when I run following code: <code>torch.load('./temptemp/v1/best_0.pt')['model']</code>. it is very strange, I didn't call the module named <code>models</code>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 927811,
          "author_name": "zaber666",
          "author_url": "",
          "post_date": "07/13/2020 15:38:30",
          "content": "<p>I guess you are using yolov5 here.\nYou have to clone the yolov5 repo to your working directory.\nThen use !cp yolov5/models .\nIt will solve your problem.\nIf you are on kaggle use yolov5 as a dataset and import the models directory.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 938654,
      "author_name": "anku5hk",
      "author_url": "",
      "post_date": "07/21/2020 16:50:17",
      "content": "<p>Hey! tried uploading on google drive? and download in some kernel with gdown?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "923915": "I have trained the model on my own local GPU device and got weights files.  But how to use the saved weights to infer the test dataset on kaggle notebook? I try to upload weights files to kaggle datasets but failed due to the slow internet. And I also try to upload weights files to github and git clone to notebook, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. I'm going crazy about this problem! How to solve this problem? Thanks a lot!🤝 🤝 🤝",
    "924367": "You have to upload it as a Kaggle dataset, there's no way around that because your submission kernel cannot have internet.",
    "924468": "If the upload is unreliable I guess you could upload 1 weights file at a time. Either load each file into separate datasets or into new versions of the same dataset. This may help a bit?",
    "924931": "If you are having slow internet issue, then you should try kaggle api.\nYou can directly upload your weight files from google drive to a kaggle dataset with this api and it is super fast. You will have it done within few seconds to be specific.\nhttps://github.com/Kaggle/kaggle-api give this a look.",
    "927601": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
    "927602": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
    "927603": "Thanks a lot! I could upload weight file through github, but it raises an error `ModuleNotFoundError: No module named 'models'` when I run following code: `torch.load('./temptemp/v1/best_0.pt')['model']`. it is very strange, I didn't call the module named `models`.",
    "927811": "I guess you are using yolov5 here.\nYou have to clone the yolov5 repo to your working directory.\nThen use !cp yolov5/models .\nIt will solve your problem.\nIf you are on kaggle use yolov5 as a dataset and import the models directory.",
    "938654": "Hey! tried uploading on google drive? and download in some kernel with gdown?"
  },
  "source": "meta"
}