{
  "id": 148875,
  "title": "how extract the zip file in kaggle kernel",
  "url": "/competitions/dogs-vs-cats/discussion/148875",
  "author_name": "M_Ariyan",
  "post_date": "2020-05-06T01:47:13.778000",
  "votes": 0,
  "comment_count": 6,
  "views": 0,
  "content": "<p>i am struggling with extracting the images from train.zip and test.zip.\ni check other notebook and everyone import the zip files as it is already unziped and it exist in directory.\ncan you help me find a solution for this issue?!</p>",
  "messages": [
    {
      "id": 1123994,
      "postDate": "2020-12-23T16:20:03.213Z",
      "content": "<p>!unzip -d path</p>",
      "rawMarkdown": "!unzip -d path",
      "votes": 1
    },
    {
      "id": 839352,
      "postDate": "2020-05-09T10:38:10.993Z",
      "content": "<p>Python has a dedicated library <a href=\"https://docs.python.org/3/library/zipfile.html\">zipfile</a> that deals with unzipping files. You can take a look at my <a href=\"https://www.kaggle.com/angqx95/intro-to-transfer-learning-fine-tuning\">kernel</a> as well.\n````\nimport zipfile  </p>\n\n<h1>extract zipped files into temp folder</h1>\n\n<p>with zipfile.ZipFile(file,\"r\") as zip_ref: <br>\n      zip_ref.extractall(\"temp\")\n````</p>",
      "rawMarkdown": "Python has a dedicated library [zipfile](https://docs.python.org/3/library/zipfile.html) that deals with unzipping files. You can take a look at my [kernel](https://www.kaggle.com/angqx95/intro-to-transfer-learning-fine-tuning) as well.\n````\nimport zipfile  \n\n#extract zipped files into temp folder\nwith zipfile.ZipFile(file,\"r\") as zip_ref:  \n      zip_ref.extractall(\"temp\")\n````",
      "votes": 1
    },
    {
      "id": 835079,
      "postDate": "2020-05-06T03:14:18.913Z",
      "content": "<p>Hey Ariyan!</p>\n\n<p>I faced the same issues back then, so after searching for a bit I made this baseline DL <a href=\"https://www.kaggle.com/siraznaorem/cats-vs-dogs-baseline-model-1st-dl-practice\">kernel</a>. It should show you all the necessary codes to unzip, preprocess images into numpy, make a very basic keras model, and clear the output directory before making csv file (so output has only csv file and is not filled with cat and dogs images).</p>\n\n<p>Hope it helps you out.\nStay safe buddy!</p>",
      "rawMarkdown": "Hey Ariyan!\n\nI faced the same issues back then, so after searching for a bit I made this baseline DL [kernel](https://www.kaggle.com/siraznaorem/cats-vs-dogs-baseline-model-1st-dl-practice). It should show you all the necessary codes to unzip, preprocess images into numpy, make a very basic keras model, and clear the output directory before making csv file (so output has only csv file and is not filled with cat and dogs images).\n\nHope it helps you out.\nStay safe buddy!",
      "votes": 2,
      "replies": [
        {
          "id": 835312,
          "postDate": "2020-05-06T07:23:26.197Z",
          "content": "<p>Dear <a href=\"/siraznaorem\">@siraznaorem</a>, great solution, just one comment; I would recommend adding the <em>-q</em> flag. This will perform the inflation <em>quietly</em> and so not fill up your notebook:</p>\n\n<blockquote>\n  <p><code>!unzip -q</code></p>\n</blockquote>\n\n<p>All the best,\ncarl</p>",
          "rawMarkdown": "Dear @siraznaorem, great solution, just one comment; I would recommend adding the *-q* flag. This will perform the inflation *quietly* and so not fill up your notebook:\n\n&gt; `!unzip -q`\n\nAll the best,\ncarl",
          "votes": 2
        },
        {
          "id": 835347,
          "postDate": "2020-05-06T08:06:24.450Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 835875,
      "postDate": "2020-05-06T15:05:16.330Z",
      "content": "<p>hi dear <a href=\"/carlmcbrideellis\">@carlmcbrideellis</a> \ni use <code>!unzip ../input/dogs-vs-cats/train.zip -q train</code> and  get the <br>\n <code>caution: filename not matched:  -q</code> <br>\n<code>caution: filename not matched:  train</code> <br>\n response. is it right?</p>",
      "rawMarkdown": "hi dear @carlmcbrideellis \ni use `!unzip ../input/dogs-vs-cats/train.zip -q train` and  get the  \n `caution: filename not matched:  -q`    \n`caution: filename not matched:  train`  \n response. is it right?"
    },
    {
      "id": 835016,
      "postDate": "2020-05-06T01:47:13.780Z",
      "content": "<p>i am struggling with extracting the images from train.zip and test.zip.\ni check other notebook and everyone import the zip files as it is already unziped and it exist in directory.\ncan you help me find a solution for this issue?!</p>",
      "rawMarkdown": "i am struggling with extracting the images from train.zip and test.zip.\ni check other notebook and everyone import the zip files as it is already unziped and it exist in directory.\ncan you help me find a solution for this issue?!"
    }
  ],
  "comments": [
    {
      "id": 1123994,
      "author_name": "harishml",
      "author_url": "",
      "post_date": "2020-12-23T16:20:03.213000",
      "content": "<p>!unzip -d path</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 839352,
      "author_name": "aqx",
      "author_url": "",
      "post_date": "2020-05-09T10:38:10.993000",
      "content": "<p>Python has a dedicated library <a href=\"https://docs.python.org/3/library/zipfile.html\">zipfile</a> that deals with unzipping files. You can take a look at my <a href=\"https://www.kaggle.com/angqx95/intro-to-transfer-learning-fine-tuning\">kernel</a> as well.\n````\nimport zipfile  </p>\n\n<h1>extract zipped files into temp folder</h1>\n\n<p>with zipfile.ZipFile(file,\"r\") as zip_ref: <br>\n      zip_ref.extractall(\"temp\")\n````</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 835079,
      "author_name": "Siraz Naorem",
      "author_url": "",
      "post_date": "2020-05-06T03:14:18.913000",
      "content": "<p>Hey Ariyan!</p>\n\n<p>I faced the same issues back then, so after searching for a bit I made this baseline DL <a href=\"https://www.kaggle.com/siraznaorem/cats-vs-dogs-baseline-model-1st-dl-practice\">kernel</a>. It should show you all the necessary codes to unzip, preprocess images into numpy, make a very basic keras model, and clear the output directory before making csv file (so output has only csv file and is not filled with cat and dogs images).</p>\n\n<p>Hope it helps you out.\nStay safe buddy!</p>",
      "votes": 2,
      "replies": [
        {
          "id": 835312,
          "author_name": "Carl McBride Ellis",
          "author_url": "",
          "post_date": "2020-05-06T07:23:26.197000",
          "content": "<p>Dear <a href=\"/siraznaorem\">@siraznaorem</a>, great solution, just one comment; I would recommend adding the <em>-q</em> flag. This will perform the inflation <em>quietly</em> and so not fill up your notebook:</p>\n\n<blockquote>\n  <p><code>!unzip -q</code></p>\n</blockquote>\n\n<p>All the best,\ncarl</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 835347,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-05-06T08:06:24.450000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 835875,
      "author_name": "M_Ariyan",
      "author_url": "",
      "post_date": "2020-05-06T15:05:16.330000",
      "content": "<p>hi dear <a href=\"/carlmcbrideellis\">@carlmcbrideellis</a> \ni use <code>!unzip ../input/dogs-vs-cats/train.zip -q train</code> and  get the <br>\n <code>caution: filename not matched:  -q</code> <br>\n<code>caution: filename not matched:  train</code> <br>\n response. is it right?</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1123994": "!unzip -d path",
    "839352": "Python has a dedicated library [zipfile](https://docs.python.org/3/library/zipfile.html) that deals with unzipping files. You can take a look at my [kernel](https://www.kaggle.com/angqx95/intro-to-transfer-learning-fine-tuning) as well.\n````\nimport zipfile  \n\n#extract zipped files into temp folder\nwith zipfile.ZipFile(file,\"r\") as zip_ref:  \n      zip_ref.extractall(\"temp\")\n````",
    "835079": "Hey Ariyan!\n\nI faced the same issues back then, so after searching for a bit I made this baseline DL [kernel](https://www.kaggle.com/siraznaorem/cats-vs-dogs-baseline-model-1st-dl-practice). It should show you all the necessary codes to unzip, preprocess images into numpy, make a very basic keras model, and clear the output directory before making csv file (so output has only csv file and is not filled with cat and dogs images).\n\nHope it helps you out.\nStay safe buddy!",
    "835875": "hi dear @carlmcbrideellis \ni use `!unzip ../input/dogs-vs-cats/train.zip -q train` and  get the  \n `caution: filename not matched:  -q`    \n`caution: filename not matched:  train`  \n response. is it right?",
    "835016": "i am struggling with extracting the images from train.zip and test.zip.\ni check other notebook and everyone import the zip files as it is already unziped and it exist in directory.\ncan you help me find a solution for this issue?!"
  }
}