{
  "id": 134943,
  "title": "efficientnet b6 implementation",
  "url": "/competitions/bengaliai-cv19/discussion/134943",
  "author_name": "",
  "post_date": "2020-03-11T08:19:42.945459800Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I don't know why i'm getting same error over a period.</p>\n\n<p>It works well in my private jupyter kernel; however, efficientnet is not successfully installed in my kaggle kernel.</p>\n\n<p>import efficientnet as efn \nfrom tensorflow.keras.models import load_model</p>\n\n<p>model = load_model('/kaggle/input/efficientnetb6-30/efficientnetb6_30.h5')</p>\n\n<p>Error code:\nModuleNotFoundError: No module named 'efficientnet.keras'</p>\n\n<p>I tried two things.\n1.  pip install -U git+<a href=\"https://github.com/qubvel/efficientnet\">https://github.com/qubvel/efficientnet</a>\n2. pip install /kaggle/input/whl-file/keras_efficientnets-0.1.7-py2.py3-none-any.whl</p>\n\n<p>please help me on this issue.</p>",
  "messages": [
    {
      "id": "768827",
      "postDate": "03/11/2020 08:19:42",
      "content": "<p>I don't know why i'm getting same error over a period.</p>\n\n<p>It works well in my private jupyter kernel; however, efficientnet is not successfully installed in my kaggle kernel.</p>\n\n<p>import efficientnet as efn \nfrom tensorflow.keras.models import load_model</p>\n\n<p>model = load_model('/kaggle/input/efficientnetb6-30/efficientnetb6_30.h5')</p>\n\n<p>Error code:\nModuleNotFoundError: No module named 'efficientnet.keras'</p>\n\n<p>I tried two things.\n1.  pip install -U git+<a href=\"https://github.com/qubvel/efficientnet\">https://github.com/qubvel/efficientnet</a>\n2. pip install /kaggle/input/whl-file/keras_efficientnets-0.1.7-py2.py3-none-any.whl</p>\n\n<p>please help me on this issue.</p>",
      "rawMarkdown": "I don't know why i'm getting same error over a period.\n\nIt works well in my private jupyter kernel; however, efficientnet is not successfully installed in my kaggle kernel.\n\nimport efficientnet as efn \nfrom tensorflow.keras.models import load_model\n\nmodel = load_model('/kaggle/input/efficientnetb6-30/efficientnetb6_30.h5')\n\nError code:\nModuleNotFoundError: No module named 'efficientnet.keras'\n\nI tried two things.\n1.  pip install -U git+https://github.com/qubvel/efficientnet\n2. pip install /kaggle/input/whl-file/keras_efficientnets-0.1.7-py2.py3-none-any.whl\n\nplease help me on this issue.",
      "votes": null
    },
    {
      "id": "769156",
      "postDate": "03/11/2020 15:36:56",
      "content": "<p>Your number 1 and number 2 are different GitHub repositories and different packages. </p>\n\n<p>If you want to use (1) qubvel's, then you should either do <code>import efficientnet.keras as efn</code> or <code>import efficientnet.tfkeras as efn</code>.</p>\n\n<p>If you want to use (2) titu1994's, then you should do <code>import keras_efficientnets as efn</code></p>",
      "rawMarkdown": "Your number 1 and number 2 are different GitHub repositories and different packages. \n\nIf you want to use (1) qubvel's, then you should either do `import efficientnet.keras as efn ` or `import efficientnet.tfkeras as efn`.\n\nIf you want to use (2) titu1994's, then you should do `import keras_efficientnets as efn`",
      "votes": null
    },
    {
      "id": "770013",
      "postDate": "03/12/2020 13:39:27",
      "content": "<p>I had issues loading efficient net with some extra layers - the loader needs help on the definition of customized layers. </p>\n\n<p>One work-around is to create the <code>model</code> again in your inference kernel and use <code>model.load_weights</code> rather than <code>load_model</code> function to load the weights. The <code>model.load_weights</code> can point to the same file as you use as input to <code>load_model</code>.</p>",
      "rawMarkdown": "I had issues loading efficient net with some extra layers - the loader needs help on the definition of customized layers. \n\nOne work-around is to create the `model` again in your inference kernel and use `model.load_weights` rather than `load_model` function to load the weights. The `model.load_weights` can point to the same file as you use as input to `load_model`.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 769156,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "03/11/2020 15:36:56",
      "content": "<p>Your number 1 and number 2 are different GitHub repositories and different packages. </p>\n\n<p>If you want to use (1) qubvel's, then you should either do <code>import efficientnet.keras as efn</code> or <code>import efficientnet.tfkeras as efn</code>.</p>\n\n<p>If you want to use (2) titu1994's, then you should do <code>import keras_efficientnets as efn</code></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 770013,
      "author_name": "barnwellguy",
      "author_url": "",
      "post_date": "03/12/2020 13:39:27",
      "content": "<p>I had issues loading efficient net with some extra layers - the loader needs help on the definition of customized layers. </p>\n\n<p>One work-around is to create the <code>model</code> again in your inference kernel and use <code>model.load_weights</code> rather than <code>load_model</code> function to load the weights. The <code>model.load_weights</code> can point to the same file as you use as input to <code>load_model</code>.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "768827": "I don't know why i'm getting same error over a period.\n\nIt works well in my private jupyter kernel; however, efficientnet is not successfully installed in my kaggle kernel.\n\nimport efficientnet as efn \nfrom tensorflow.keras.models import load_model\n\nmodel = load_model('/kaggle/input/efficientnetb6-30/efficientnetb6_30.h5')\n\nError code:\nModuleNotFoundError: No module named 'efficientnet.keras'\n\nI tried two things.\n1.  pip install -U git+https://github.com/qubvel/efficientnet\n2. pip install /kaggle/input/whl-file/keras_efficientnets-0.1.7-py2.py3-none-any.whl\n\nplease help me on this issue.",
    "769156": "Your number 1 and number 2 are different GitHub repositories and different packages. \n\nIf you want to use (1) qubvel's, then you should either do `import efficientnet.keras as efn ` or `import efficientnet.tfkeras as efn`.\n\nIf you want to use (2) titu1994's, then you should do `import keras_efficientnets as efn`",
    "770013": "I had issues loading efficient net with some extra layers - the loader needs help on the definition of customized layers. \n\nOne work-around is to create the `model` again in your inference kernel and use `model.load_weights` rather than `load_model` function to load the weights. The `model.load_weights` can point to the same file as you use as input to `load_model`."
  },
  "source": "meta"
}