{
  "id": 103082,
  "title": "How do you switch from resnet 34 to resnet 50",
  "url": "/competitions/aptos2019-blindness-detection/discussion/103082",
  "author_name": "",
  "post_date": "2019-08-07T02:07:48.035235500Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Hi, \nI am pretty new to kernels (and deep learning). I am using a kernel that uses fast.ai and resnet 34  and I would like to switch to resnet 50 but I am not sure how to go about it. I found a fast.ai script using resnet 50 that was forked from the same kernel I am using, I am reading it to try to replace the cells in the notebook, but I got an error that a directory doesn't exist, so I am wondering switching goes beyond just changing code. </p>\n\n<p>The code that refers directly to resnet 34 is. </p>\n\n<p>Path('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet34/resnet34.pth' '/tmp/.cache/torch/checkpoints/resnet34-333f7ec4.pth'</p>\n\n<p>when I swap this out with </p>\n\n<p>Path('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet50/resnet50.pth' '/tmp/.cache/torch/checkpoints/resnet50-19c8e357.pth'</p>\n\n<p>I get an error: cp: cannot stat '../input/resnet50/resnet50.pth': No such file or directory</p>\n\n<p>which seems to say I am missing something as far as kernel setup goes. \nIf anyone could help me out how to do this change I would appreciate it. </p>",
  "messages": [
    {
      "id": "593700",
      "postDate": "08/07/2019 02:07:48",
      "content": "<p>Hi, \nI am pretty new to kernels (and deep learning). I am using a kernel that uses fast.ai and resnet 34  and I would like to switch to resnet 50 but I am not sure how to go about it. I found a fast.ai script using resnet 50 that was forked from the same kernel I am using, I am reading it to try to replace the cells in the notebook, but I got an error that a directory doesn't exist, so I am wondering switching goes beyond just changing code. </p>\n\n<p>The code that refers directly to resnet 34 is. </p>\n\n<p>Path('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet34/resnet34.pth' '/tmp/.cache/torch/checkpoints/resnet34-333f7ec4.pth'</p>\n\n<p>when I swap this out with </p>\n\n<p>Path('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet50/resnet50.pth' '/tmp/.cache/torch/checkpoints/resnet50-19c8e357.pth'</p>\n\n<p>I get an error: cp: cannot stat '../input/resnet50/resnet50.pth': No such file or directory</p>\n\n<p>which seems to say I am missing something as far as kernel setup goes. \nIf anyone could help me out how to do this change I would appreciate it. </p>",
      "rawMarkdown": "Hi, \nI am pretty new to kernels (and deep learning). I am using a kernel that uses fast.ai and resnet 34  and I would like to switch to resnet 50 but I am not sure how to go about it. I found a fast.ai script using resnet 50 that was forked from the same kernel I am using, I am reading it to try to replace the cells in the notebook, but I got an error that a directory doesn't exist, so I am wondering switching goes beyond just changing code. \n\nThe code that refers directly to resnet 34 is. \n\n\nPath('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet34/resnet34.pth' '/tmp/.cache/torch/checkpoints/resnet34-333f7ec4.pth'\n\nwhen I swap this out with \n\nPath('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet50/resnet50.pth' '/tmp/.cache/torch/checkpoints/resnet50-19c8e357.pth'\n\nI get an error: cp: cannot stat '../input/resnet50/resnet50.pth': No such file or directory\n\nwhich seems to say I am missing something as far as kernel setup goes. \nIf anyone could help me out how to do this change I would appreciate it.",
      "votes": null
    },
    {
      "id": "593950",
      "postDate": "08/07/2019 10:26:28",
      "content": "<p>I think you changed this part correctly, you can check this in my ResNet 50 kernel: <a href=\"https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50\">https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50</a></p>\n\n<p>Could you check that there is resnet50.pth file is in Data section of kernel actually?</p>",
      "rawMarkdown": "I think you changed this part correctly, you can check this in my ResNet 50 kernel: https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50\n\nCould you check that there is resnet50.pth file is in Data section of kernel actually?",
      "votes": null
    },
    {
      "id": "594136",
      "postDate": "08/07/2019 16:16:49",
      "content": "<p>Hey Chris, Can you just print the list of files in the input directory using the command  - print(os.listdir('../input/resnet50'). If the resnet50 pretrained model is present, it will list down the file. If not, you can add resnet50 pretrained model from the add data option from the top right corner of the kernel. </p>",
      "rawMarkdown": "Hey Chris, Can you just print the list of files in the input directory using the command  - print(os.listdir('../input/resnet50'). If the resnet50 pretrained model is present, it will list down the file. If not, you can add resnet50 pretrained model from the add data option from the top right corner of the kernel.",
      "votes": null
    },
    {
      "id": "594172",
      "postDate": "08/07/2019 17:00:09",
      "content": "<p>Salut je veux  un algorithme qui récupéré les articles  d'un site eCommerce par BeautifulSoup  et ensuite prédire le prix de l'article</p>",
      "rawMarkdown": "Salut je veux  un algorithme qui récupéré les articles  d'un site eCommerce par BeautifulSoup  et ensuite prédire le prix de l'article",
      "votes": null
    },
    {
      "id": "594355",
      "postDate": "08/07/2019 22:08:25",
      "content": "<p>I am now pretty sure that is actually the problem.  I don't have a folder or res50 data files and I don't know how to add them. </p>",
      "rawMarkdown": "I am now pretty sure that is actually the problem.  I don't have a folder or res50 data files and I don't know how to add them.",
      "votes": null
    },
    {
      "id": "594526",
      "postDate": "08/08/2019 06:15:26",
      "content": "<p><a href=\"/chrisfs\">@chrisfs</a> OK, go to Edit your kernel, press Add Data at the top, you will see the window for adding Datasets. In the textbox Search Datasets type resnet50. You'll see the list of pretrained models, select one for Pytorch (since you are using Pytorch or fast.ai), click Add near this dataset. Basically that's it. Hope it helps.</p>",
      "rawMarkdown": "chrisfs OK, go to Edit your kernel, press Add Data at the top, you will see the window for adding Datasets. In the textbox Search Datasets type resnet50. You'll see the list of pretrained models, select one for Pytorch (since you are using Pytorch or fast.ai), click Add near this dataset. Basically that's it. Hope it helps.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 593950,
      "author_name": "demonplus",
      "author_url": "",
      "post_date": "08/07/2019 10:26:28",
      "content": "<p>I think you changed this part correctly, you can check this in my ResNet 50 kernel: <a href=\"https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50\">https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50</a></p>\n\n<p>Could you check that there is resnet50.pth file is in Data section of kernel actually?</p>",
      "votes": null,
      "replies": [
        {
          "id": 594172,
          "author_name": "atcheikh",
          "author_url": "",
          "post_date": "08/07/2019 17:00:09",
          "content": "<p>Salut je veux  un algorithme qui récupéré les articles  d'un site eCommerce par BeautifulSoup  et ensuite prédire le prix de l'article</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 594355,
          "author_name": "chrisfs",
          "author_url": "",
          "post_date": "08/07/2019 22:08:25",
          "content": "<p>I am now pretty sure that is actually the problem.  I don't have a folder or res50 data files and I don't know how to add them. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 594526,
          "author_name": "demonplus",
          "author_url": "",
          "post_date": "08/08/2019 06:15:26",
          "content": "<p><a href=\"/chrisfs\">@chrisfs</a> OK, go to Edit your kernel, press Add Data at the top, you will see the window for adding Datasets. In the textbox Search Datasets type resnet50. You'll see the list of pretrained models, select one for Pytorch (since you are using Pytorch or fast.ai), click Add near this dataset. Basically that's it. Hope it helps.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 594136,
      "author_name": "manojprabhaakr",
      "author_url": "",
      "post_date": "08/07/2019 16:16:49",
      "content": "<p>Hey Chris, Can you just print the list of files in the input directory using the command  - print(os.listdir('../input/resnet50'). If the resnet50 pretrained model is present, it will list down the file. If not, you can add resnet50 pretrained model from the add data option from the top right corner of the kernel. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "593700": "Hi, \nI am pretty new to kernels (and deep learning). I am using a kernel that uses fast.ai and resnet 34  and I would like to switch to resnet 50 but I am not sure how to go about it. I found a fast.ai script using resnet 50 that was forked from the same kernel I am using, I am reading it to try to replace the cells in the notebook, but I got an error that a directory doesn't exist, so I am wondering switching goes beyond just changing code. \n\nThe code that refers directly to resnet 34 is. \n\n\nPath('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet34/resnet34.pth' '/tmp/.cache/torch/checkpoints/resnet34-333f7ec4.pth'\n\nwhen I swap this out with \n\nPath('/tmp/.cache/torch/checkpoints/').mkdir(exist_ok=True, parents=True)\n!cp '../input/resnet50/resnet50.pth' '/tmp/.cache/torch/checkpoints/resnet50-19c8e357.pth'\n\nI get an error: cp: cannot stat '../input/resnet50/resnet50.pth': No such file or directory\n\nwhich seems to say I am missing something as far as kernel setup goes. \nIf anyone could help me out how to do this change I would appreciate it.",
    "593950": "I think you changed this part correctly, you can check this in my ResNet 50 kernel: https://www.kaggle.com/demonplus/fast-ai-starter-with-resnet-50\n\nCould you check that there is resnet50.pth file is in Data section of kernel actually?",
    "594136": "Hey Chris, Can you just print the list of files in the input directory using the command  - print(os.listdir('../input/resnet50'). If the resnet50 pretrained model is present, it will list down the file. If not, you can add resnet50 pretrained model from the add data option from the top right corner of the kernel.",
    "594172": "Salut je veux  un algorithme qui récupéré les articles  d'un site eCommerce par BeautifulSoup  et ensuite prédire le prix de l'article",
    "594355": "I am now pretty sure that is actually the problem.  I don't have a folder or res50 data files and I don't know how to add them.",
    "594526": "chrisfs OK, go to Edit your kernel, press Add Data at the top, you will see the window for adding Datasets. In the textbox Search Datasets type resnet50. You'll see the list of pretrained models, select one for Pytorch (since you are using Pytorch or fast.ai), click Add near this dataset. Basically that's it. Hope it helps."
  },
  "source": "meta"
}