{
  "id": 97944,
  "title": "my kernel dies automatically when converting images to array",
  "url": "/competitions/aptos2019-blindness-detection/discussion/97944",
  "author_name": "kabilan",
  "post_date": "2019-06-30T04:11:47.911000",
  "votes": 0,
  "comment_count": 5,
  "views": 0,
  "content": "",
  "messages": [
    {
      "id": 565825,
      "postDate": "2019-07-01T12:27:28.950Z",
      "content": "<p>You might be trying to append all the images into a list without downscaling the images to a standard size. Resize the images and change the array dtype to uint32. This can be achieved as follows:\n<code>python\nimg = np.array(Image.open(&lt;image_path&gt;),dtype=np.unit32)\nresized = cv2.resize(img, (height, width))\n</code></p>",
      "rawMarkdown": "You might be trying to append all the images into a list without downscaling the images to a standard size. Resize the images and change the array dtype to uint32. This can be achieved as follows:\n```python\nimg = np.array(Image.open(",
      "votes": 1
    },
    {
      "id": 564829,
      "postDate": "2019-06-30T04:11:47.910Z",
      "rawMarkdown": ""
    },
    {
      "id": 588831,
      "postDate": "2019-07-31T05:29:03.590Z",
      "content": "<p>I was also facing the same image because was doing exactly what Tushar explained. Now i am resizing the images and just plotting few of them instead of storing in array.</p>",
      "rawMarkdown": "I was also facing the same image because was doing exactly what Tushar explained. Now i am resizing the images and just plotting few of them instead of storing in array."
    },
    {
      "id": 565820,
      "postDate": "2019-07-01T12:16:16.073Z",
      "content": "<p>Likely RAM related issue. You can also lower image sizes.</p>",
      "rawMarkdown": "Likely RAM related issue. You can also lower image sizes."
    },
    {
      "id": 565753,
      "postDate": "2019-07-01T10:33:22.067Z",
      "content": "<p>It might be possible that you do not have enough RAM to store each image in an array. Maybe using a data generator or a patch based approach can fix your issue. Also clearing your ram before converting the images might help, see <a href=\"https://www.kaggle.com/questions-and-answers/55558\">this</a> q&amp;a.</p>",
      "rawMarkdown": "It might be possible that you do not have enough RAM to store each image in an array. Maybe using a data generator or a patch based approach can fix your issue. Also clearing your ram before converting the images might help, see [this](https://www.kaggle.com/questions-and-answers/55558) q&amp;a."
    },
    {
      "id": 565110,
      "postDate": "2019-06-30T12:56:20.880Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 565825,
      "author_name": "Tushar",
      "author_url": "",
      "post_date": "2019-07-01T12:27:28.950000",
      "content": "<p>You might be trying to append all the images into a list without downscaling the images to a standard size. Resize the images and change the array dtype to uint32. This can be achieved as follows:\n<code>python\nimg = np.array(Image.open(&lt;image_path&gt;),dtype=np.unit32)\nresized = cv2.resize(img, (height, width))\n</code></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 588831,
      "author_name": "NeerajSharma",
      "author_url": "",
      "post_date": "2019-07-31T05:29:03.590000",
      "content": "<p>I was also facing the same image because was doing exactly what Tushar explained. Now i am resizing the images and just plotting few of them instead of storing in array.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 565820,
      "author_name": "Tim Yee",
      "author_url": "",
      "post_date": "2019-07-01T12:16:16.073000",
      "content": "<p>Likely RAM related issue. You can also lower image sizes.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 565753,
      "author_name": "pepijn",
      "author_url": "",
      "post_date": "2019-07-01T10:33:22.067000",
      "content": "<p>It might be possible that you do not have enough RAM to store each image in an array. Maybe using a data generator or a patch based approach can fix your issue. Also clearing your ram before converting the images might help, see <a href=\"https://www.kaggle.com/questions-and-answers/55558\">this</a> q&amp;a.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 565110,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-06-30T12:56:20.880000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "565825": "You might be trying to append all the images into a list without downscaling the images to a standard size. Resize the images and change the array dtype to uint32. This can be achieved as follows:\n```python\nimg = np.array(Image.open(",
    "564829": "",
    "588831": "I was also facing the same image because was doing exactly what Tushar explained. Now i am resizing the images and just plotting few of them instead of storing in array.",
    "565820": "Likely RAM related issue. You can also lower image sizes.",
    "565753": "It might be possible that you do not have enough RAM to store each image in an array. Maybe using a data generator or a patch based approach can fix your issue. Also clearing your ram before converting the images might help, see [this](https://www.kaggle.com/questions-and-answers/55558) q&amp;a.",
    "565110": ""
  }
}