{
  "id": 253275,
  "title": "Running Kaggle models in Colab",
  "url": "/competitions/siim-covid19-detection/discussion/253275",
  "author_name": "",
  "post_date": "2021-07-15T18:18:13.997455Z",
  "votes": 5,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hello<br>\nAfter having some issues this week witht the TPUs, I decided to use colab for TPU training.</p>\n<p>I can access to kaggle databases from could and train new models.</p>\n<p>Nevertheless I would like to know if there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?</p>\n<p>What I'm doing but is not working</p>\n<p>1.- Create a kaggle dataset which contains my trained models.<br>\n2.- use the google cloud link <br>\nmodel0w='gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5'<br>\nmodels0.load_weights(model0w)</p>\n<p>I received an error, like there is not any file<br>\nOSError: Unable to open file (unable to open file: name = 'gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)</p>\n<p>Nevertheless Im able to read csv files stored in the same database without any problem.</p>\n<p>Question again <br>\n<strong>is there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?</strong></p>",
  "messages": [
    {
      "id": "1389470",
      "postDate": "07/15/2021 18:18:13",
      "content": "<p>Hello<br>\nAfter having some issues this week witht the TPUs, I decided to use colab for TPU training.</p>\n<p>I can access to kaggle databases from could and train new models.</p>\n<p>Nevertheless I would like to know if there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?</p>\n<p>What I'm doing but is not working</p>\n<p>1.- Create a kaggle dataset which contains my trained models.<br>\n2.- use the google cloud link <br>\nmodel0w='gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5'<br>\nmodels0.load_weights(model0w)</p>\n<p>I received an error, like there is not any file<br>\nOSError: Unable to open file (unable to open file: name = 'gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)</p>\n<p>Nevertheless Im able to read csv files stored in the same database without any problem.</p>\n<p>Question again <br>\n<strong>is there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?</strong></p>",
      "rawMarkdown": "Hello\nAfter having some issues this week witht the TPUs, I decided to use colab for TPU training.\n\nI can access to kaggle databases from could and train new models.\n\nNevertheless I would like to know if there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?\n\nWhat I'm doing but is not working\n\n1.- Create a kaggle dataset which contains my trained models.\n2.- use the google cloud link \nmodel0w='gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5'\nmodels0.load_weights(model0w)\n\nI received an error, like there is not any file\nOSError: Unable to open file (unable to open file: name = 'gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)\n\n\nNevertheless Im able to read csv files stored in the same database without any problem.\n\nQuestion again \n**is there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?**",
      "votes": null
    },
    {
      "id": "1390430",
      "postDate": "07/16/2021 16:29:14",
      "content": "<p>I have the same question. </p>",
      "rawMarkdown": "I have the same question.",
      "votes": null
    },
    {
      "id": "1390488",
      "postDate": "07/16/2021 17:26:31",
      "content": "<p>tried with kaggle API ?<br>\n<a href=\"https://github.com/Kaggle/kaggle-api\" target=\"_blank\">https://github.com/Kaggle/kaggle-api</a><br>\n<a href=\"https://www.kaggle.com/docs/api\" target=\"_blank\">https://www.kaggle.com/docs/api</a></p>",
      "rawMarkdown": "tried with kaggle API ?\nhttps://github.com/Kaggle/kaggle-api\nhttps://www.kaggle.com/docs/api",
      "votes": null
    },
    {
      "id": "1392825",
      "postDate": "07/19/2021 05:53:08",
      "content": "<p>Hello, <a href=\"https://www.kaggle.com/omararias86\" target=\"_blank\">@omararias86</a> , colab can directly import data or models from kaggle Datasets, however can not import these from kaggle notebooks. So you need to upload your data or models from kaggle notebooks to kaggle Datasets. Then you can use kaggle api to download data or models from kaggle Datasets to colab. For example:<br>\n<code># Download timm package</code><br>\n<code>!mkdir -p '/content/timm-pytorch-image-models'</code><br>\n<code>!kaggle datasets download -d kozodoi/timm-pytorch-image-models -p '../content'</code><br>\n<code>!unzip -n '/content/timm-pytorch-image-models.zip' -d '/content/timm-pytorch-image-models'</code><br>\n<code>!rm '/content/timm-pytorch-image-models.zip'</code></p>\n<p>You can also try it with your own private Datasets.</p>",
      "rawMarkdown": "Hello, @omararias86 , colab can directly import data or models from kaggle Datasets, however can not import these from kaggle notebooks. So you need to upload your data or models from kaggle notebooks to kaggle Datasets. Then you can use kaggle api to download data or models from kaggle Datasets to colab. For example:\n`# Download timm package`\n`!mkdir -p '/content/timm-pytorch-image-models'`\n`!kaggle datasets download -d kozodoi/timm-pytorch-image-models -p '../content'`\n`!unzip -n '/content/timm-pytorch-image-models.zip' -d '/content/timm-pytorch-image-models'`\n`!rm '/content/timm-pytorch-image-models.zip'`\n\nYou can also try it with your own private Datasets.",
      "votes": null
    },
    {
      "id": "1396198",
      "postDate": "07/21/2021 22:01:35",
      "content": "<p>Thanks guys, I will try with your recommendations! </p>",
      "rawMarkdown": "Thanks guys, I will try with your recommendations!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1390430,
      "author_name": "carolinasilvadev",
      "author_url": "",
      "post_date": "07/16/2021 16:29:14",
      "content": "<p>I have the same question. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1390488,
      "author_name": "imeintanis",
      "author_url": "",
      "post_date": "07/16/2021 17:26:31",
      "content": "<p>tried with kaggle API ?<br>\n<a href=\"https://github.com/Kaggle/kaggle-api\" target=\"_blank\">https://github.com/Kaggle/kaggle-api</a><br>\n<a href=\"https://www.kaggle.com/docs/api\" target=\"_blank\">https://www.kaggle.com/docs/api</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1392825,
      "author_name": "shangweichen",
      "author_url": "",
      "post_date": "07/19/2021 05:53:08",
      "content": "<p>Hello, <a href=\"https://www.kaggle.com/omararias86\" target=\"_blank\">@omararias86</a> , colab can directly import data or models from kaggle Datasets, however can not import these from kaggle notebooks. So you need to upload your data or models from kaggle notebooks to kaggle Datasets. Then you can use kaggle api to download data or models from kaggle Datasets to colab. For example:<br>\n<code># Download timm package</code><br>\n<code>!mkdir -p '/content/timm-pytorch-image-models'</code><br>\n<code>!kaggle datasets download -d kozodoi/timm-pytorch-image-models -p '../content'</code><br>\n<code>!unzip -n '/content/timm-pytorch-image-models.zip' -d '/content/timm-pytorch-image-models'</code><br>\n<code>!rm '/content/timm-pytorch-image-models.zip'</code></p>\n<p>You can also try it with your own private Datasets.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1396198,
      "author_name": "omararias86",
      "author_url": "",
      "post_date": "07/21/2021 22:01:35",
      "content": "<p>Thanks guys, I will try with your recommendations! </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1389470": "Hello\nAfter having some issues this week witht the TPUs, I decided to use colab for TPU training.\n\nI can access to kaggle databases from could and train new models.\n\nNevertheless I would like to know if there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?\n\nWhat I'm doing but is not working\n\n1.- Create a kaggle dataset which contains my trained models.\n2.- use the google cloud link \nmodel0w='gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5'\nmodels0.load_weights(model0w)\n\nI received an error, like there is not any file\nOSError: Unable to open file (unable to open file: name = 'gs://kds-751fd2104e0b01ffe17f3b8717a2e789bd72144bb9b74f9a0b02daae/model0.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)\n\n\nNevertheless Im able to read csv files stored in the same database without any problem.\n\nQuestion again \n**is there is a way to use already trained kaggle models in colab, without transfering them to my google drive manually?**",
    "1390430": "I have the same question.",
    "1390488": "tried with kaggle API ?\nhttps://github.com/Kaggle/kaggle-api\nhttps://www.kaggle.com/docs/api",
    "1392825": "Hello, @omararias86 , colab can directly import data or models from kaggle Datasets, however can not import these from kaggle notebooks. So you need to upload your data or models from kaggle notebooks to kaggle Datasets. Then you can use kaggle api to download data or models from kaggle Datasets to colab. For example:\n`# Download timm package`\n`!mkdir -p '/content/timm-pytorch-image-models'`\n`!kaggle datasets download -d kozodoi/timm-pytorch-image-models -p '../content'`\n`!unzip -n '/content/timm-pytorch-image-models.zip' -d '/content/timm-pytorch-image-models'`\n`!rm '/content/timm-pytorch-image-models.zip'`\n\nYou can also try it with your own private Datasets.",
    "1396198": "Thanks guys, I will try with your recommendations!"
  },
  "source": "meta"
}