{
  "id": 473735,
  "title": "Setting the base model not trainable does not work",
  "url": "/competitions/hms-harmful-brain-activity-classification/discussion/473735",
  "author_name": "Fei",
  "post_date": "2024-02-05T21:35:35.777000",
  "votes": 1,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I enjoy a lot learning from <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> 's notebook EfficientNetB2 Starter. Thought it would be a good idea to set the base model as not trainable so more epochs can be achieved more quickly.</p>\n<p>However by setting <code>base_model.trainable = False</code>, the training process got stuck right at the beginning. The two GPU meters show they are at full power. Even the \"Cancel\" button can't interrupt it. The only way to get out of is the Factory Reset to stop the session.</p>\n<p>Have you experienced the same and could you give me some clues what is causing it? Cheers!</p>\n<p>Update:<br>\n  It turns out the model created without the <code>strategy</code> can fine tune. But the fixed layers can only be up to 13. When it's more than that, the validation cost will be nan. The reason is still unknown.</p>",
  "messages": [
    {
      "id": 2637787,
      "postDate": "2024-02-05T21:35:35.777Z",
      "content": "<p>I enjoy a lot learning from <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> 's notebook EfficientNetB2 Starter. Thought it would be a good idea to set the base model as not trainable so more epochs can be achieved more quickly.</p>\n<p>However by setting <code>base_model.trainable = False</code>, the training process got stuck right at the beginning. The two GPU meters show they are at full power. Even the \"Cancel\" button can't interrupt it. The only way to get out of is the Factory Reset to stop the session.</p>\n<p>Have you experienced the same and could you give me some clues what is causing it? Cheers!</p>\n<p>Update:<br>\n  It turns out the model created without the <code>strategy</code> can fine tune. But the fixed layers can only be up to 13. When it's more than that, the validation cost will be nan. The reason is still unknown.</p>",
      "rawMarkdown": "I enjoy a lot learning from @cdeotte 's notebook EfficientNetB2 Starter. Thought it would be a good idea to set the base model as not trainable so more epochs can be achieved more quickly.\n\nHowever by setting `base_model.trainable = False`, the training process got stuck right at the beginning. The two GPU meters show they are at full power. Even the \"Cancel\" button can't interrupt it. The only way to get out of is the Factory Reset to stop the session.\n\nHave you experienced the same and could you give me some clues what is causing it? Cheers!\n\nUpdate:\n  It turns out the model created without the ```strategy``` can fine tune. But the fixed layers can only be up to 13. When it's more than that, the validation cost will be nan. The reason is still unknown.",
      "votes": 1
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2637787": "I enjoy a lot learning from @cdeotte 's notebook EfficientNetB2 Starter. Thought it would be a good idea to set the base model as not trainable so more epochs can be achieved more quickly.\n\nHowever by setting `base_model.trainable = False`, the training process got stuck right at the beginning. The two GPU meters show they are at full power. Even the \"Cancel\" button can't interrupt it. The only way to get out of is the Factory Reset to stop the session.\n\nHave you experienced the same and could you give me some clues what is causing it? Cheers!\n\nUpdate:\n  It turns out the model created without the ```strategy``` can fine tune. But the fixed layers can only be up to 13. When it's more than that, the validation cost will be nan. The reason is still unknown."
  }
}