{
  "id": 134923,
  "title": "OSError: cannot identify image file",
  "url": "/competitions/iwildcam-2020-fgvc7/discussion/134923",
  "author_name": "",
  "post_date": "2020-03-11T05:58:01.887352100Z",
  "votes": 3,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Training with fastai was going well\nHowever, the following error occurred.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1195275%2F6f5b6d38acc56b2e5c97769c90e5c914%2Fimage1.PNG?generation=1583906175588380&amp;alt=media\" alt=\"\"></p>\n\n<p>and I have checked with glob.\n```python\nimport glob\ntrain_images = glob.glob('/kaggle/input/iwildcam-2020-fgvc7/train/*')</p>\n\n<p>train_images[0]\n'/kaggle/input/iwildcam-2020-fgvc7/train/896c1198-21bc-11ea-a13a-137349068a90.jpg' in train_images\n```</p>\n\n<p>it return <code>True</code></p>\n\n<p>What is the problem?</p>",
  "messages": [
    {
      "id": "768728",
      "postDate": "03/11/2020 05:58:01",
      "content": "<p>Training with fastai was going well\nHowever, the following error occurred.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1195275%2F6f5b6d38acc56b2e5c97769c90e5c914%2Fimage1.PNG?generation=1583906175588380&amp;alt=media\" alt=\"\"></p>\n\n<p>and I have checked with glob.\n```python\nimport glob\ntrain_images = glob.glob('/kaggle/input/iwildcam-2020-fgvc7/train/*')</p>\n\n<p>train_images[0]\n'/kaggle/input/iwildcam-2020-fgvc7/train/896c1198-21bc-11ea-a13a-137349068a90.jpg' in train_images\n```</p>\n\n<p>it return <code>True</code></p>\n\n<p>What is the problem?</p>",
      "rawMarkdown": "Training with fastai was going well\nHowever, the following error occurred.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1195275%2F6f5b6d38acc56b2e5c97769c90e5c914%2Fimage1.PNG?generation=1583906175588380&amp;alt=media)\n\nand I have checked with glob.\n```python\nimport glob\ntrain_images = glob.glob('/kaggle/input/iwildcam-2020-fgvc7/train/*')\n\ntrain_images[0]\n'/kaggle/input/iwildcam-2020-fgvc7/train/896c1198-21bc-11ea-a13a-137349068a90.jpg' in train_images\n```\n\nit return `True`\n\nWhat is the problem?",
      "votes": null
    },
    {
      "id": "768736",
      "postDate": "03/11/2020 06:08:07",
      "content": "<p>I'm trying this below,</p>\n\n<p>```\nfrom PIL import Image, ImageFile</p>\n\n<p>ImageFile.LOAD_TRUNCATED_IMAGES = True\n```</p>\n\n<p>ref: <a href=\"https://github.com/python-pillow/Pillow/issues/3287\">https://github.com/python-pillow/Pillow/issues/3287</a></p>",
      "rawMarkdown": "I'm trying this below,\n\n```\nfrom PIL import Image, ImageFile\n\nImageFile.LOAD_TRUNCATED_IMAGES = True\n```\n\nref: https://github.com/python-pillow/Pillow/issues/3287",
      "votes": null
    },
    {
      "id": "769092",
      "postDate": "03/11/2020 14:22:23",
      "content": "<p>It looks like a few of the images are missing the jpeg end characters. Did the solution you tried above work?</p>",
      "rawMarkdown": "It looks like a few of the images are missing the jpeg end characters. Did the solution you tried above work?",
      "votes": null
    },
    {
      "id": "769627",
      "postDate": "03/12/2020 05:16:44",
      "content": "<p>No, it doesn't work. However, I've found the images from 'location 537' have the jpeg end error. I dropped them out for training. And there is no more error for that. :) To avoid this error completely, try image loader in different libraries like openCV.</p>",
      "rawMarkdown": "No, it doesn't work. However, I've found the images from 'location 537' have the jpeg end error. I dropped them out for training. And there is no more error for that. :) To avoid this error completely, try image loader in different libraries like openCV.",
      "votes": null
    },
    {
      "id": "771170",
      "postDate": "03/13/2020 20:41:57",
      "content": "<p>Hi\nThere were an error about \"turnication\" (?), which is solved by these lines of codes in Keras. I am now facing another error about \"identfying image file\". I think I have to remove the files as well from my ref dataframe.</p>",
      "rawMarkdown": "Hi\nThere were an error about \"turnication\" (?), which is solved by these lines of codes in Keras. I am now facing another error about \"identfying image file\". I think I have to remove the files as well from my ref dataframe.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 768736,
      "author_name": "seriousran",
      "author_url": "",
      "post_date": "03/11/2020 06:08:07",
      "content": "<p>I'm trying this below,</p>\n\n<p>```\nfrom PIL import Image, ImageFile</p>\n\n<p>ImageFile.LOAD_TRUNCATED_IMAGES = True\n```</p>\n\n<p>ref: <a href=\"https://github.com/python-pillow/Pillow/issues/3287\">https://github.com/python-pillow/Pillow/issues/3287</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 769092,
          "author_name": "sbeery",
          "author_url": "",
          "post_date": "03/11/2020 14:22:23",
          "content": "<p>It looks like a few of the images are missing the jpeg end characters. Did the solution you tried above work?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 769627,
          "author_name": "seriousran",
          "author_url": "",
          "post_date": "03/12/2020 05:16:44",
          "content": "<p>No, it doesn't work. However, I've found the images from 'location 537' have the jpeg end error. I dropped them out for training. And there is no more error for that. :) To avoid this error completely, try image loader in different libraries like openCV.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 771170,
          "author_name": "mohammadmortaji",
          "author_url": "",
          "post_date": "03/13/2020 20:41:57",
          "content": "<p>Hi\nThere were an error about \"turnication\" (?), which is solved by these lines of codes in Keras. I am now facing another error about \"identfying image file\". I think I have to remove the files as well from my ref dataframe.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "768728": "Training with fastai was going well\nHowever, the following error occurred.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1195275%2F6f5b6d38acc56b2e5c97769c90e5c914%2Fimage1.PNG?generation=1583906175588380&amp;alt=media)\n\nand I have checked with glob.\n```python\nimport glob\ntrain_images = glob.glob('/kaggle/input/iwildcam-2020-fgvc7/train/*')\n\ntrain_images[0]\n'/kaggle/input/iwildcam-2020-fgvc7/train/896c1198-21bc-11ea-a13a-137349068a90.jpg' in train_images\n```\n\nit return `True`\n\nWhat is the problem?",
    "768736": "I'm trying this below,\n\n```\nfrom PIL import Image, ImageFile\n\nImageFile.LOAD_TRUNCATED_IMAGES = True\n```\n\nref: https://github.com/python-pillow/Pillow/issues/3287",
    "769092": "It looks like a few of the images are missing the jpeg end characters. Did the solution you tried above work?",
    "769627": "No, it doesn't work. However, I've found the images from 'location 537' have the jpeg end error. I dropped them out for training. And there is no more error for that. :) To avoid this error completely, try image loader in different libraries like openCV.",
    "771170": "Hi\nThere were an error about \"turnication\" (?), which is solved by these lines of codes in Keras. I am now facing another error about \"identfying image file\". I think I have to remove the files as well from my ref dataframe."
  },
  "source": "meta"
}