{
  "id": 145541,
  "title": "Error reading the images locally !",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/145541",
  "author_name": "Yaheaal",
  "post_date": "2020-04-23T15:30:00.571000",
  "votes": 4,
  "comment_count": 9,
  "views": 0,
  "content": "<p>After I downloaded the images , I've tried to read them like I did before in the kernel by using : \n<code>skimage.io.MultiImage('0005f7aaab2800f6170c399693a96917.tiff')[-1]</code>\nIn the kaggle kernel the code return the array of the image but on my laptop it shows error ...</p>\n\n<blockquote>\n  <p>ValueError: cannot decompress jpeg</p>\n</blockquote>\n\n<p>I tried to read them with different libraries and still showing the same error.</p>\n\n<p>Any help ? :)</p>",
  "messages": [
    {
      "id": 818048,
      "postDate": "2020-04-23T15:50:30.480Z",
      "content": "<p>You need to install tifffile. </p>\n\n<p><code>pip install tifffile</code></p>",
      "rawMarkdown": "You need to install tifffile. \n\n`pip install tifffile`",
      "votes": 3,
      "replies": [
        {
          "id": 818084,
          "postDate": "2020-04-23T16:10:21.737Z",
          "content": "<p>Thanks :), It works after downloading it and restarting the kernel </p>",
          "rawMarkdown": "Thanks :), It works after downloading it and restarting the kernel "
        },
        {
          "id": 836982,
          "postDate": "2020-05-07T12:24:33.310Z",
          "content": "<p><a href=\"/yaheaal\">@yaheaal</a> hi, i did <code>pip install tiffile</code> and restarted kernel but it still doesn't work, any ideas?</p>",
          "rawMarkdown": "@yaheaal hi, i did `pip install tiffile` and restarted kernel but it still doesn't work, any ideas?\n"
        },
        {
          "id": 837106,
          "postDate": "2020-05-07T14:16:46.637Z",
          "content": "<p>Try this :</p>\n\n<p><code>\nimport skimage.io\nimport tifffile\ndef image_processing(img_path, size=(SIZE,SIZE)):\n    img = skimage.io.MultiImage(img_path)\n    resize = cv2.resize(img[-1], size)\n    return resize\n</code></p>",
          "rawMarkdown": "Try this :\n\n```\nimport skimage.io\nimport tifffile\ndef image_processing(img_path, size=(SIZE,SIZE)):\n    img = skimage.io.MultiImage(img_path)\n    resize = cv2.resize(img[-1], size)\n    return resize\n```"
        }
      ]
    },
    {
      "id": 818003,
      "postDate": "2020-04-23T15:30:00.573Z",
      "content": "<p>After I downloaded the images , I've tried to read them like I did before in the kernel by using : \n<code>skimage.io.MultiImage('0005f7aaab2800f6170c399693a96917.tiff')[-1]</code>\nIn the kaggle kernel the code return the array of the image but on my laptop it shows error ...</p>\n\n<blockquote>\n  <p>ValueError: cannot decompress jpeg</p>\n</blockquote>\n\n<p>I tried to read them with different libraries and still showing the same error.</p>\n\n<p>Any help ? :)</p>",
      "rawMarkdown": "After I downloaded the images , I've tried to read them like I did before in the kernel by using : \n`skimage.io.MultiImage('0005f7aaab2800f6170c399693a96917.tiff')[-1]`\nIn the kaggle kernel the code return the array of the image but on my laptop it shows error ...\n\n&gt; ValueError: cannot decompress jpeg\n\nI tried to read them with different libraries and still showing the same error.\n\nAny help ? :)\n",
      "votes": 4
    },
    {
      "id": 821471,
      "postDate": "2020-04-26T07:39:00.173Z",
      "content": "<p>Hi,</p>\n\n<p>I had the same problem. Since I use conda, based on Your suggestions I first tried:\n<code>&gt; conda install tifffile</code>\nBut the above seemed not to be enough. The version from Kaggle (2020.2.16) differed from Conda's (0.15.1). Next, I tried:\n<code>&gt; conda install -c conda-forge tifffile=2020.2.16</code>\nBut then, skimage complained about not having found the imagecodecs package. Conda ships with imagecodecs-lite, but does not provide imagecodecs! The only way I found to workaround it was:\n<code>&gt; pip install imagecodecs</code></p>\n\n<p>Thus, I ended up with some <code>pip install ...</code> in my conda environment (I dislike mixing them both)...</p>\n\n<p>Regards,\nPaweł</p>",
      "rawMarkdown": "Hi,\n\nI had the same problem. Since I use conda, based on Your suggestions I first tried:\n```&gt; conda install tifffile```\nBut the above seemed not to be enough. The version from Kaggle (2020.2.16) differed from Conda's (0.15.1). Next, I tried:\n```&gt; conda install -c conda-forge tifffile=2020.2.16```\nBut then, skimage complained about not having found the imagecodecs package. Conda ships with imagecodecs-lite, but does not provide imagecodecs! The only way I found to workaround it was:\n```&gt; pip install imagecodecs```\n\nThus, I ended up with some ```pip install ...``` in my conda environment (I dislike mixing them both)...\n\nRegards,\nPaweł",
      "votes": 2
    },
    {
      "id": 818309,
      "postDate": "2020-04-23T19:28:04.283Z",
      "content": "<p>Use imageio</p>",
      "rawMarkdown": "Use imageio",
      "replies": [
        {
          "id": 877405,
          "postDate": "2020-06-07T15:12:39.950Z",
          "content": "<p>works for me, great! </p>",
          "rawMarkdown": "works for me, great! ",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 818046,
      "postDate": "2020-04-23T15:49:23.883Z",
      "content": "<p>Have you checked the path of the image. </p>",
      "rawMarkdown": "Have you checked the path of the image. ",
      "replies": [
        {
          "id": 818055,
          "postDate": "2020-04-23T15:53:00.200Z",
          "content": "<p>Yes , still not working .\nIt's hard to just use kaggle kernel in this comp , because need to check the result of your NN every time you change something but we only have 30h gpu , that's why am trying to use my laptop :)</p>",
          "rawMarkdown": "Yes , still not working .\nIt's hard to just use kaggle kernel in this comp , because need to check the result of your NN every time you change something but we only have 30h gpu , that's why am trying to use my laptop :)"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 818048,
      "author_name": "Ian Pan",
      "author_url": "",
      "post_date": "2020-04-23T15:50:30.480000",
      "content": "<p>You need to install tifffile. </p>\n\n<p><code>pip install tifffile</code></p>",
      "votes": 3,
      "replies": [
        {
          "id": 818084,
          "author_name": "Yaheaal",
          "author_url": "",
          "post_date": "2020-04-23T16:10:21.737000",
          "content": "<p>Thanks :), It works after downloading it and restarting the kernel </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 836982,
          "author_name": "wayfarer",
          "author_url": "",
          "post_date": "2020-05-07T12:24:33.310000",
          "content": "<p><a href=\"/yaheaal\">@yaheaal</a> hi, i did <code>pip install tiffile</code> and restarted kernel but it still doesn't work, any ideas?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 837106,
          "author_name": "Yaheaal",
          "author_url": "",
          "post_date": "2020-05-07T14:16:46.637000",
          "content": "<p>Try this :</p>\n\n<p><code>\nimport skimage.io\nimport tifffile\ndef image_processing(img_path, size=(SIZE,SIZE)):\n    img = skimage.io.MultiImage(img_path)\n    resize = cv2.resize(img[-1], size)\n    return resize\n</code></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 821471,
      "author_name": "Paweł Ryszawa",
      "author_url": "",
      "post_date": "2020-04-26T07:39:00.173000",
      "content": "<p>Hi,</p>\n\n<p>I had the same problem. Since I use conda, based on Your suggestions I first tried:\n<code>&gt; conda install tifffile</code>\nBut the above seemed not to be enough. The version from Kaggle (2020.2.16) differed from Conda's (0.15.1). Next, I tried:\n<code>&gt; conda install -c conda-forge tifffile=2020.2.16</code>\nBut then, skimage complained about not having found the imagecodecs package. Conda ships with imagecodecs-lite, but does not provide imagecodecs! The only way I found to workaround it was:\n<code>&gt; pip install imagecodecs</code></p>\n\n<p>Thus, I ended up with some <code>pip install ...</code> in my conda environment (I dislike mixing them both)...</p>\n\n<p>Regards,\nPaweł</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 818309,
      "author_name": "Harshit Sheoran",
      "author_url": "",
      "post_date": "2020-04-23T19:28:04.283000",
      "content": "<p>Use imageio</p>",
      "votes": 0,
      "replies": [
        {
          "id": 877405,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-06-07T15:12:39.950000",
          "content": "<p>works for me, great! </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 818046,
      "author_name": "Dracarys",
      "author_url": "",
      "post_date": "2020-04-23T15:49:23.883000",
      "content": "<p>Have you checked the path of the image. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 818055,
          "author_name": "Yaheaal",
          "author_url": "",
          "post_date": "2020-04-23T15:53:00.200000",
          "content": "<p>Yes , still not working .\nIt's hard to just use kaggle kernel in this comp , because need to check the result of your NN every time you change something but we only have 30h gpu , that's why am trying to use my laptop :)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "818048": "You need to install tifffile. \n\n`pip install tifffile`",
    "818003": "After I downloaded the images , I've tried to read them like I did before in the kernel by using : \n`skimage.io.MultiImage('0005f7aaab2800f6170c399693a96917.tiff')[-1]`\nIn the kaggle kernel the code return the array of the image but on my laptop it shows error ...\n\n&gt; ValueError: cannot decompress jpeg\n\nI tried to read them with different libraries and still showing the same error.\n\nAny help ? :)\n",
    "821471": "Hi,\n\nI had the same problem. Since I use conda, based on Your suggestions I first tried:\n```&gt; conda install tifffile```\nBut the above seemed not to be enough. The version from Kaggle (2020.2.16) differed from Conda's (0.15.1). Next, I tried:\n```&gt; conda install -c conda-forge tifffile=2020.2.16```\nBut then, skimage complained about not having found the imagecodecs package. Conda ships with imagecodecs-lite, but does not provide imagecodecs! The only way I found to workaround it was:\n```&gt; pip install imagecodecs```\n\nThus, I ended up with some ```pip install ...``` in my conda environment (I dislike mixing them both)...\n\nRegards,\nPaweł",
    "818309": "Use imageio",
    "818046": "Have you checked the path of the image. "
  }
}