{
  "id": 211281,
  "title": "Trouble getting NoisyStudent weights for EfficientNet ",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/211281",
  "author_name": "",
  "post_date": "2021-01-14T15:07:42.288958900Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I'm having trouble getting the NoisyStudent weights for the EfficientNet. I have downloaded the checkpoint from here (<a href=\"https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet\" target=\"_blank\">https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet</a>) and found a guide (<a href=\"https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights)\" target=\"_blank\">https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights)</a>. I'm stuck on the line \"Then use the script efficientnet_weight_update_util.py to convert ckpt file to h5 file.\" I found the script, but have no idea what to do now. I copied the script and tried to run it locally in the same folder as the checkpoint via the given command, but no success. Is there a way to do all of that within a kaggle notebook?</p>\n<p>Any help is appreciated and thanks in advance!</p>",
  "messages": [
    {
      "id": "1152939",
      "postDate": "01/14/2021 15:07:42",
      "content": "<p>I'm having trouble getting the NoisyStudent weights for the EfficientNet. I have downloaded the checkpoint from here (<a href=\"https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet\" target=\"_blank\">https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet</a>) and found a guide (<a href=\"https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights)\" target=\"_blank\">https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights)</a>. I'm stuck on the line \"Then use the script efficientnet_weight_update_util.py to convert ckpt file to h5 file.\" I found the script, but have no idea what to do now. I copied the script and tried to run it locally in the same folder as the checkpoint via the given command, but no success. Is there a way to do all of that within a kaggle notebook?</p>\n<p>Any help is appreciated and thanks in advance!</p>",
      "rawMarkdown": "I'm having trouble getting the NoisyStudent weights for the EfficientNet. I have downloaded the checkpoint from here (https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) and found a guide (https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights). I'm stuck on the line \"Then use the script efficientnet_weight_update_util.py to convert ckpt file to h5 file.\" I found the script, but have no idea what to do now. I copied the script and tried to run it locally in the same folder as the checkpoint via the given command, but no success. Is there a way to do all of that within a kaggle notebook?\n\nAny help is appreciated and thanks in advance!",
      "votes": null
    },
    {
      "id": "1153407",
      "postDate": "01/14/2021 21:35:30",
      "content": "<p>!python efficientnet_weight_update_util.py --model b1 --notop --ckpt \\<br>\n        efficientnet-b1/model.ckpt --o efficientnetb1_notop.h5</p>\n<p>The above command works. <br>\n<a href=\"https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/\" target=\"_blank\">https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/</a></p>",
      "rawMarkdown": "!python efficientnet_weight_update_util.py --model b1 --notop --ckpt \\\n        efficientnet-b1/model.ckpt --o efficientnetb1_notop.h5\n\nThe above command works. \nhttps://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/",
      "votes": null
    },
    {
      "id": "1153565",
      "postDate": "01/15/2021 02:16:51",
      "content": "<p>Try this<br>\n!pip install efficientnet<br>\nAnd then<br>\nbase_model = efn.EfficientNetB4(weights='noisy-student')</p>",
      "rawMarkdown": "Try this\n!pip install efficientnet\nAnd then\nbase_model = efn.EfficientNetB4(weights='noisy-student')",
      "votes": null
    },
    {
      "id": "1153566",
      "postDate": "01/15/2021 02:16:51",
      "content": "<p>Try this<br>\n!pip install efficientnet<br>\nAnd then<br>\nbase_model = efn.EfficientNetB4(weights='noisy-student')</p>",
      "rawMarkdown": "Try this\n!pip install efficientnet\nAnd then\nbase_model = efn.EfficientNetB4(weights='noisy-student')",
      "votes": null
    },
    {
      "id": "1154767",
      "postDate": "01/15/2021 21:56:15",
      "content": "<p>In case anyone is using the <code>timm</code> package, the noisy-student weights are also included in there.</p>\n<p>just:</p>\n<p><code>timm.create_model(\"tf_efficientnet_b4_ns\", pretrained=True)</code></p>",
      "rawMarkdown": "In case anyone is using the `timm` package, the noisy-student weights are also included in there.\n\njust:\n\n`timm.create_model(\"tf_efficientnet_b4_ns\", pretrained=True)`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1153407,
      "author_name": "sahini",
      "author_url": "",
      "post_date": "01/14/2021 21:35:30",
      "content": "<p>!python efficientnet_weight_update_util.py --model b1 --notop --ckpt \\<br>\n        efficientnet-b1/model.ckpt --o efficientnetb1_notop.h5</p>\n<p>The above command works. <br>\n<a href=\"https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/\" target=\"_blank\">https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1153565,
      "author_name": "mithilsalunkhe",
      "author_url": "",
      "post_date": "01/15/2021 02:16:51",
      "content": "<p>Try this<br>\n!pip install efficientnet<br>\nAnd then<br>\nbase_model = efn.EfficientNetB4(weights='noisy-student')</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1153566,
      "author_name": "mithilsalunkhe",
      "author_url": "",
      "post_date": "01/15/2021 02:16:51",
      "content": "<p>Try this<br>\n!pip install efficientnet<br>\nAnd then<br>\nbase_model = efn.EfficientNetB4(weights='noisy-student')</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1154767,
      "author_name": "aliabdin1",
      "author_url": "",
      "post_date": "01/15/2021 21:56:15",
      "content": "<p>In case anyone is using the <code>timm</code> package, the noisy-student weights are also included in there.</p>\n<p>just:</p>\n<p><code>timm.create_model(\"tf_efficientnet_b4_ns\", pretrained=True)</code></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1152939": "I'm having trouble getting the NoisyStudent weights for the EfficientNet. I have downloaded the checkpoint from here (https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) and found a guide (https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/#using-the-latest-efficientnet-weights). I'm stuck on the line \"Then use the script efficientnet_weight_update_util.py to convert ckpt file to h5 file.\" I found the script, but have no idea what to do now. I copied the script and tried to run it locally in the same folder as the checkpoint via the given command, but no success. Is there a way to do all of that within a kaggle notebook?\n\nAny help is appreciated and thanks in advance!",
    "1153407": "!python efficientnet_weight_update_util.py --model b1 --notop --ckpt \\\n        efficientnet-b1/model.ckpt --o efficientnetb1_notop.h5\n\nThe above command works. \nhttps://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/",
    "1153565": "Try this\n!pip install efficientnet\nAnd then\nbase_model = efn.EfficientNetB4(weights='noisy-student')",
    "1153566": "Try this\n!pip install efficientnet\nAnd then\nbase_model = efn.EfficientNetB4(weights='noisy-student')",
    "1154767": "In case anyone is using the `timm` package, the noisy-student weights are also included in there.\n\njust:\n\n`timm.create_model(\"tf_efficientnet_b4_ns\", pretrained=True)`"
  },
  "source": "meta"
}