{
  "id": 205021,
  "title": "Resource Exhaust Error",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/205021",
  "author_name": "",
  "post_date": "2020-12-18T03:40:39.860498700Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hi Everyone,</p>\n<p>Is anyone facing this error ? </p>\n<p>train_data_generator = idg.flow_from_dataframe(train, directory = \"../input/cassava-leaf-disease-classification/train_images\",<br>\n                             x_col = \"image_id\", y_col = \"label\",<br>\n                             class_mode = \"categorical\", shuffle = True,<br>\n                             batch_size=64)<br>\n    valid_data_generator  = idg.flow_from_dataframe(validation, directory = \"../input/cassava-leaf-disease-classification/train_images\",<br>\n                             x_col = \"image_id\", y_col = \"label\",<br>\n                             class_mode = \"categorical\", shuffle = True)</p>\n<pre><code>model = create_model()\nmodel.compile(optimizer=RMSprop(learning_rate=1e-4),\n                loss=SparseCategoricalCrossentropy(), metrics=['accuracy'])\n\nhistory = model.fit(train_data_generator,\n                    epochs=10,\n                    validation_data=valid_data_generator)\n</code></pre>\n<p>ResourceExhaustedError:  OOM when allocating tensor with shape[64,1392,8,8] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc</p>",
  "messages": [
    {
      "id": "1117430",
      "postDate": "12/18/2020 03:40:39",
      "content": "<p>Hi Everyone,</p>\n<p>Is anyone facing this error ? </p>\n<p>train_data_generator = idg.flow_from_dataframe(train, directory = \"../input/cassava-leaf-disease-classification/train_images\",<br>\n                             x_col = \"image_id\", y_col = \"label\",<br>\n                             class_mode = \"categorical\", shuffle = True,<br>\n                             batch_size=64)<br>\n    valid_data_generator  = idg.flow_from_dataframe(validation, directory = \"../input/cassava-leaf-disease-classification/train_images\",<br>\n                             x_col = \"image_id\", y_col = \"label\",<br>\n                             class_mode = \"categorical\", shuffle = True)</p>\n<pre><code>model = create_model()\nmodel.compile(optimizer=RMSprop(learning_rate=1e-4),\n                loss=SparseCategoricalCrossentropy(), metrics=['accuracy'])\n\nhistory = model.fit(train_data_generator,\n                    epochs=10,\n                    validation_data=valid_data_generator)\n</code></pre>\n<p>ResourceExhaustedError:  OOM when allocating tensor with shape[64,1392,8,8] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc</p>",
      "rawMarkdown": "Hi Everyone,\n\nIs anyone facing this error ? \n\ntrain_data_generator = idg.flow_from_dataframe(train, directory = \"../input/cassava-leaf-disease-classification/train_images\",\n                             x_col = \"image_id\", y_col = \"label\",\n                             class_mode = \"categorical\", shuffle = True,\n                             batch_size=64)\n    valid_data_generator  = idg.flow_from_dataframe(validation, directory = \"../input/cassava-leaf-disease-classification/train_images\",\n                             x_col = \"image_id\", y_col = \"label\",\n                             class_mode = \"categorical\", shuffle = True)\n    \n    model = create_model()\n    model.compile(optimizer=RMSprop(learning_rate=1e-4),\n                    loss=SparseCategoricalCrossentropy(), metrics=['accuracy'])\n    \n    history = model.fit(train_data_generator,\n                        epochs=10,\n                        validation_data=valid_data_generator)\n\n\nResourceExhaustedError:  OOM when allocating tensor with shape[64,1392,8,8] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc",
      "votes": null
    },
    {
      "id": "1117720",
      "postDate": "12/18/2020 11:09:54",
      "content": "<p><a href=\"https://www.kaggle.com/mosrihari\" target=\"_blank\">@mosrihari</a> maybe the combination of a big model (i.e. EfficientNetB6), image resolution (are you using 512x512?), and the batch size 64.</p>\n<p>I would suggest you reduce one of them, or maybe all of them just to make sure.</p>",
      "rawMarkdown": "mosrihari maybe the combination of a big model (i.e. EfficientNetB6), image resolution (are you using 512x512?), and the batch size 64.\n\nI would suggest you reduce one of them, or maybe all of them just to make sure.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1117720,
      "author_name": "dimitreoliveira",
      "author_url": "",
      "post_date": "12/18/2020 11:09:54",
      "content": "<p><a href=\"https://www.kaggle.com/mosrihari\" target=\"_blank\">@mosrihari</a> maybe the combination of a big model (i.e. EfficientNetB6), image resolution (are you using 512x512?), and the batch size 64.</p>\n<p>I would suggest you reduce one of them, or maybe all of them just to make sure.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1117430": "Hi Everyone,\n\nIs anyone facing this error ? \n\ntrain_data_generator = idg.flow_from_dataframe(train, directory = \"../input/cassava-leaf-disease-classification/train_images\",\n                             x_col = \"image_id\", y_col = \"label\",\n                             class_mode = \"categorical\", shuffle = True,\n                             batch_size=64)\n    valid_data_generator  = idg.flow_from_dataframe(validation, directory = \"../input/cassava-leaf-disease-classification/train_images\",\n                             x_col = \"image_id\", y_col = \"label\",\n                             class_mode = \"categorical\", shuffle = True)\n    \n    model = create_model()\n    model.compile(optimizer=RMSprop(learning_rate=1e-4),\n                    loss=SparseCategoricalCrossentropy(), metrics=['accuracy'])\n    \n    history = model.fit(train_data_generator,\n                        epochs=10,\n                        validation_data=valid_data_generator)\n\n\nResourceExhaustedError:  OOM when allocating tensor with shape[64,1392,8,8] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc",
    "1117720": "mosrihari maybe the combination of a big model (i.e. EfficientNetB6), image resolution (are you using 512x512?), and the batch size 64.\n\nI would suggest you reduce one of them, or maybe all of them just to make sure."
  },
  "source": "meta"
}