{
  "id": 370469,
  "title": "How can I use fastai and resnet18?",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/370469",
  "author_name": "JonathanGrant",
  "post_date": "2022-12-04T17:19:49.403000",
  "votes": 0,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I want to download resnet18 and fastai dependencies, but we cannot use internet. I tried compiling a zip file in a previous notebook output, but it seems to fail with that too. Is there any way to do this?</p>",
  "messages": [
    {
      "id": 2055189,
      "postDate": "2022-12-04T20:25:01.530Z",
      "content": "<p>Fast AI is preinstalled so you can just import the relevant modules.  </p>\n<p>Most people do their training in a different notebook ( or on their own computer etc) than the notebook that is used to do the submission (inference).  </p>\n<p>*Only the submission notebook has to be offline.  *</p>\n<p>So in an <strong>online</strong> notebook; train your model using resnet18 (downloading pretrained model etc) separately; export your model and put it into a Kaggle dataset (private dataset is fine); </p>\n<p>Then for inference (make an <strong>offline</strong> notebook) pull in your dataset that has your model.  You can use  Fast AI's load_learner function to load the model you trained (you no longer need the resnet18 pretrained model) and generate your results.</p>\n<p>There are some other things that you will probably need installed into your offline notebook other than Fast AI (to deal with jpeg2000 dicoms etc) … Here are the only ones that I need… with instructions on how to install them in your offline notebook… </p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795</a></p>",
      "rawMarkdown": "Fast AI is preinstalled so you can just import the relevant modules.  \n\nMost people do their training in a different notebook ( or on their own computer etc) than the notebook that is used to do the submission (inference).  \n\n*Only the submission notebook has to be offline.  *\n\nSo in an **online** notebook; train your model using resnet18 (downloading pretrained model etc) separately; export your model and put it into a Kaggle dataset (private dataset is fine); \n\nThen for inference (make an **offline** notebook) pull in your dataset that has your model.  You can use  Fast AI's load_learner function to load the model you trained (you no longer need the resnet18 pretrained model) and generate your results.\n\nThere are some other things that you will probably need installed into your offline notebook other than Fast AI (to deal with jpeg2000 dicoms etc) ... Here are the only ones that I need... with instructions on how to install them in your offline notebook... \n\nhttps://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795",
      "votes": 2,
      "replies": [
        {
          "id": 2055203,
          "postDate": "2022-12-04T21:11:43.250Z",
          "content": "<p>Thanks! Just what I needed</p>",
          "rawMarkdown": "Thanks! Just what I needed"
        }
      ]
    },
    {
      "id": 2055034,
      "postDate": "2022-12-04T17:19:49.403Z",
      "content": "<p>I want to download resnet18 and fastai dependencies, but we cannot use internet. I tried compiling a zip file in a previous notebook output, but it seems to fail with that too. Is there any way to do this?</p>",
      "rawMarkdown": "I want to download resnet18 and fastai dependencies, but we cannot use internet. I tried compiling a zip file in a previous notebook output, but it seems to fail with that too. Is there any way to do this?"
    }
  ],
  "comments": [
    {
      "id": 2055189,
      "author_name": "John Robinson",
      "author_url": "",
      "post_date": "2022-12-04T20:25:01.530000",
      "content": "<p>Fast AI is preinstalled so you can just import the relevant modules.  </p>\n<p>Most people do their training in a different notebook ( or on their own computer etc) than the notebook that is used to do the submission (inference).  </p>\n<p>*Only the submission notebook has to be offline.  *</p>\n<p>So in an <strong>online</strong> notebook; train your model using resnet18 (downloading pretrained model etc) separately; export your model and put it into a Kaggle dataset (private dataset is fine); </p>\n<p>Then for inference (make an <strong>offline</strong> notebook) pull in your dataset that has your model.  You can use  Fast AI's load_learner function to load the model you trained (you no longer need the resnet18 pretrained model) and generate your results.</p>\n<p>There are some other things that you will probably need installed into your offline notebook other than Fast AI (to deal with jpeg2000 dicoms etc) … Here are the only ones that I need… with instructions on how to install them in your offline notebook… </p>\n<p><a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795</a></p>",
      "votes": 2,
      "replies": [
        {
          "id": 2055203,
          "author_name": "JonathanGrant",
          "author_url": "",
          "post_date": "2022-12-04T21:11:43.250000",
          "content": "<p>Thanks! Just what I needed</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2055189": "Fast AI is preinstalled so you can just import the relevant modules.  \n\nMost people do their training in a different notebook ( or on their own computer etc) than the notebook that is used to do the submission (inference).  \n\n*Only the submission notebook has to be offline.  *\n\nSo in an **online** notebook; train your model using resnet18 (downloading pretrained model etc) separately; export your model and put it into a Kaggle dataset (private dataset is fine); \n\nThen for inference (make an **offline** notebook) pull in your dataset that has your model.  You can use  Fast AI's load_learner function to load the model you trained (you no longer need the resnet18 pretrained model) and generate your results.\n\nThere are some other things that you will probably need installed into your offline notebook other than Fast AI (to deal with jpeg2000 dicoms etc) ... Here are the only ones that I need... with instructions on how to install them in your offline notebook... \n\nhttps://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412#1918795",
    "2055034": "I want to download resnet18 and fastai dependencies, but we cannot use internet. I tried compiling a zip file in a previous notebook output, but it seems to fail with that too. Is there any way to do this?"
  }
}