{
  "id": 145203,
  "title": "404 - Not Found while trying to download the data",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/145203",
  "author_name": "Emre Bayram",
  "post_date": "2020-04-22T09:07:38.063000",
  "votes": 5,
  "comment_count": 7,
  "views": 0,
  "content": "<p>I am getting 404 - Not found error while trying to download the data.\n<code>\n(base) emre@emre-desktop:~$ kaggle competitions download -c prostate-cancer-grade-assessment\n404 - Not Found\n</code></p>\n\n<p>My system:\nlocal jupyter server on Ubuntu</p>\n\n<ul>\n<li>I have .kaggle/kaggle.json in my home folder.</li>\n<li>I have installed kaggle api</li>\n<li>I have tried both from command line and within jupyter notebook</li>\n<li>I have accepted the competition rules</li>\n<li>I have tried after restarting the notebook etc.</li>\n</ul>\n\n<p>Any idea?</p>",
  "messages": [
    {
      "id": 816314,
      "postDate": "2020-04-22T09:07:38.063Z",
      "content": "<p>I am getting 404 - Not found error while trying to download the data.\n<code>\n(base) emre@emre-desktop:~$ kaggle competitions download -c prostate-cancer-grade-assessment\n404 - Not Found\n</code></p>\n\n<p>My system:\nlocal jupyter server on Ubuntu</p>\n\n<ul>\n<li>I have .kaggle/kaggle.json in my home folder.</li>\n<li>I have installed kaggle api</li>\n<li>I have tried both from command line and within jupyter notebook</li>\n<li>I have accepted the competition rules</li>\n<li>I have tried after restarting the notebook etc.</li>\n</ul>\n\n<p>Any idea?</p>",
      "rawMarkdown": "I am getting 404 - Not found error while trying to download the data.\n`\n(base) emre@emre-desktop:~$ kaggle competitions download -c prostate-cancer-grade-assessment\n404 - Not Found\n`\n\nMy system:\nlocal jupyter server on Ubuntu\n\n- I have .kaggle/kaggle.json in my home folder.\n- I have installed kaggle api\n- I have tried both from command line and within jupyter notebook\n- I have accepted the competition rules\n- I have tried after restarting the notebook etc.\n\nAny idea?",
      "votes": 5
    },
    {
      "id": 816759,
      "postDate": "2020-04-22T15:06:11.017Z",
      "content": "<p>Hi, I suffered the same thing.  I was able to downloaded cvs files and test files manually, but I couldn't download the training files.  Inspired by your solution  (thanks by the way, because I'd never used kaggle's API before) I made the following code:</p>\n\n<p><code>\ndef download_kaggle(train):\n    files = pd.read_csv(train)  # Read file with images data\n    files = 'train_images/' + files[\"image_id\"] + '.tiff' # Create an object that concatenate directory localization <br>\n                                                                        # and file extension with file name\n    for file in files:\n        !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n        time.sleep(10) # Pause the loop so that not too many download requests are \n                    # made and the files are not blocked from downloading\n</code></p>\n\n<p>Update: this code only download 20 files.  I trying to figure out how down load the remaining files</p>",
      "rawMarkdown": "Hi, I suffered the same thing.  I was able to downloaded cvs files and test files manually, but I couldn't download the training files.  Inspired by your solution  (thanks by the way, because I'd never used kaggle's API before) I made the following code:\n\n```\ndef download_kaggle(train):\n    files = pd.read_csv(train)  # Read file with images data\n    files = 'train_images/' + files[\"image_id\"] + '.tiff' # Create an object that concatenate directory localization  \n                                                                        # and file extension with file name\n    for file in files:\n        !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n        time.sleep(10) # Pause the loop so that not too many download requests are \n                    # made and the files are not blocked from downloading\n```\n\nUpdate: this code only download 20 files.  I trying to figure out how down load the remaining files",
      "votes": 3
    },
    {
      "id": 816678,
      "postDate": "2020-04-22T14:05:10.310Z",
      "content": "<p>Trying out a variation of your code to get more of the files:</p>\n\n<p>`import pandas as pd\ntrain_df = pd.read_csv(\"train.csv\")</p>\n\n<p>for index, row in train_df.iterrows():\n    print(\"Id \", index, \"File\", row['image_id'])\n    #print(row['image_id'] + '.tiff') \n    tiff_zip_file = \"train_images/\" + row['image_id'] + '.tiff'\n    tiff_mask_file = \"train_label_masks/\" + row['image_id'] + '.tiff'\n    # Download the files.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_zip_file}\n    #Not every file has a mask, but try anyway.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_mask_file}\n    dest_tiff = 'train_images/' + row['image_id'] + '.tiff.zip'\n    dest_mask = 'mask_images/' + row['image_id'] + '.tiff.zip'\n    #Move the files into either train_images/ or mask_images/\n    !mv {row['image_id'] + '.tiff.zip'} {dest_tiff}\n    !mv {row['image_id'] + '.tiff.zip'} {dest_mask}\n    #unzip in destination folder\n    !unzip {dest_tiff} -d train_images/\n    !unzip {dest_mask} -d mask_images/\n    #remove original zips\n    !rm {dest_tiff}\n    !rm {dest_mask}`</p>\n\n<p>`</p>\n\n<p>Thanks for the template to work from!</p>\n\n<h1>works up until file 19.</h1>",
      "rawMarkdown": "Trying out a variation of your code to get more of the files:\n\n`import pandas as pd\ntrain_df = pd.read_csv(\"train.csv\")\n\nfor index, row in train_df.iterrows():\n    print(\"Id \", index, \"File\", row['image_id'])\n    #print(row['image_id'] + '.tiff') \n    tiff_zip_file = \"train_images/\" + row['image_id'] + '.tiff'\n    tiff_mask_file = \"train_label_masks/\" + row['image_id'] + '.tiff'\n    # Download the files.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_zip_file}\n    #Not every file has a mask, but try anyway.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_mask_file}\n    dest_tiff = 'train_images/' + row['image_id'] + '.tiff.zip'\n    dest_mask = 'mask_images/' + row['image_id'] + '.tiff.zip'\n    #Move the files into either train_images/ or mask_images/\n    !mv {row['image_id'] + '.tiff.zip'} {dest_tiff}\n    !mv {row['image_id'] + '.tiff.zip'} {dest_mask}\n    #unzip in destination folder\n    !unzip {dest_tiff} -d train_images/\n    !unzip {dest_mask} -d mask_images/\n    #remove original zips\n    !rm {dest_tiff}\n    !rm {dest_mask}`\n\n\n`\n\nThanks for the template to work from!\n\n# works up until file 19. ",
      "votes": 1
    },
    {
      "id": 816326,
      "postDate": "2020-04-22T09:25:20.387Z",
      "content": "<p>I was able to download file by file:</p>\n\n<p>```\nfiles = [\n\"train_label_masks/00412139e6b04d1e1cee8421f38f6e90_mask.tiff\",\n\"train_label_masks/003a91841da04a5a31f808fb5c21538a_mask.tiff\",\n\"train_label_masks/002a4db09dad406c85505a00fb6f6144_mask.tiff\", <br>\n\"train_label_masks/006f4d8d3556dd21f6424202c2d294a9_mask.tiff\", \n\"train_label_masks/001c62abd11fa4b57bf7a6c603a11bb9_mask.tiff\",\n\"train_label_masks/007433133235efc27a39f11df6940829_mask.tiff\",\n\"train_label_masks/0005f7aaab2800f6170c399693a96917_mask.tiff\", <br>\n\"train_label_masks/000920ad0b612851f8e01bcc880d9b3d_mask.tiff\", <br>\n\"train_label_masks/0018ae58b01bdadc8e347995b69f99aa_mask.tiff\", <br>\n\"train_label_masks/006f6aa35a78965c92fffd1fbd53a058_mask.tiff\", <br>\n\"train_label_masks/003d4dd6bd61221ebc0bfb9350db333f_mask.tiff\", <br>\n\"train_label_masks/004dd32d9cd167d9cc31c13b704498af_mask.tiff\", <br>\n\"train_label_masks/0068d4c7529e34fd4c9da863ce01a161_mask.tiff\", <br>\n\"train_label_masks/005e66f06bce9c2e49142536caf2f6ee_mask.tiff\", <br>\n\"train_label_masks/004391d48d58b18156f811087cd38abf_mask.tiff\", <br>\n\"train_label_masks/003046e27c8ead3e3db155780dc5498e_mask.tiff\", <br>\n\"train_label_masks/001d865e65ef5d2579c190a0e0350d8f_mask.tiff\", <br>\n\"train_label_masks/0032bfa835ce0f43a92ae0bbab6871cb_mask.tiff\", <br>\n\"train_label_masks/004f6b3a66189b4e88b6a01ba19d7d31_mask.tiff\", <br>\n\"train_label_masks/0076bcb66e46fb485f5ba432b9a1fe8a_mask.tiff\", <br>\n\"train_images/005e66f06bce9c2e49142536caf2f6ee.tiff\", <br>\n\"train_images/003d4dd6bd61221ebc0bfb9350db333f.tiff\", <br>\n\"train_images/00412139e6b04d1e1cee8421f38f6e90.tiff\", <br>\n\"train_images/001d865e65ef5d2579c190a0e0350d8f.tiff\", <br>\n\"train_images/004f6b3a66189b4e88b6a01ba19d7d31.tiff\", <br>\n\"train_images/007433133235efc27a39f11df6940829.tiff\", <br>\n\"train_images/0032bfa835ce0f43a92ae0bbab6871cb.tiff\", <br>\n\"train_images/003046e27c8ead3e3db155780dc5498e.tiff\", <br>\n\"train_images/006f4d8d3556dd21f6424202c2d294a9.tiff\", <br>\n\"train_images/004391d48d58b18156f811087cd38abf.tiff\", <br>\n\"train_images/002a4db09dad406c85505a00fb6f6144.tiff\", <br>\n\"train_images/001c62abd11fa4b57bf7a6c603a11bb9.tiff\", <br>\n\"train_images/004dd32d9cd167d9cc31c13b704498af.tiff\", <br>\n\"train_images/006f6aa35a78965c92fffd1fbd53a058.tiff\", <br>\n\"train_images/0018ae58b01bdadc8e347995b69f99aa.tiff\", <br>\n\"train_images/003a91841da04a5a31f808fb5c21538a.tiff\", <br>\n\"train_images/0005f7aaab2800f6170c399693a96917.tiff\", <br>\n\"train_images/0068d4c7529e34fd4c9da863ce01a161.tiff\", <br>\n\"train_images/0076bcb66e46fb485f5ba432b9a1fe8a.tiff\", <br>\n\"train_images/000920ad0b612851f8e01bcc880d9b3d.tiff\", <br>\n\"train.csv\", <br>\n\"sample_submission.csv\", <br>\n\"test.csv\"]</p>\n\n<p>for file in files:\n  !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n```</p>",
      "rawMarkdown": "I was able to download file by file:\n\n```\nfiles = [\n\"train_label_masks/00412139e6b04d1e1cee8421f38f6e90_mask.tiff\",\n\"train_label_masks/003a91841da04a5a31f808fb5c21538a_mask.tiff\",\n\"train_label_masks/002a4db09dad406c85505a00fb6f6144_mask.tiff\",  \n\"train_label_masks/006f4d8d3556dd21f6424202c2d294a9_mask.tiff\", \n\"train_label_masks/001c62abd11fa4b57bf7a6c603a11bb9_mask.tiff\",\n\"train_label_masks/007433133235efc27a39f11df6940829_mask.tiff\",\n\"train_label_masks/0005f7aaab2800f6170c399693a96917_mask.tiff\",  \n\"train_label_masks/000920ad0b612851f8e01bcc880d9b3d_mask.tiff\",  \n\"train_label_masks/0018ae58b01bdadc8e347995b69f99aa_mask.tiff\",  \n\"train_label_masks/006f6aa35a78965c92fffd1fbd53a058_mask.tiff\",  \n\"train_label_masks/003d4dd6bd61221ebc0bfb9350db333f_mask.tiff\",  \n\"train_label_masks/004dd32d9cd167d9cc31c13b704498af_mask.tiff\",  \n\"train_label_masks/0068d4c7529e34fd4c9da863ce01a161_mask.tiff\",  \n\"train_label_masks/005e66f06bce9c2e49142536caf2f6ee_mask.tiff\",  \n\"train_label_masks/004391d48d58b18156f811087cd38abf_mask.tiff\",  \n\"train_label_masks/003046e27c8ead3e3db155780dc5498e_mask.tiff\",  \n\"train_label_masks/001d865e65ef5d2579c190a0e0350d8f_mask.tiff\",  \n\"train_label_masks/0032bfa835ce0f43a92ae0bbab6871cb_mask.tiff\",  \n\"train_label_masks/004f6b3a66189b4e88b6a01ba19d7d31_mask.tiff\",  \n\"train_label_masks/0076bcb66e46fb485f5ba432b9a1fe8a_mask.tiff\",  \n\"train_images/005e66f06bce9c2e49142536caf2f6ee.tiff\",  \n\"train_images/003d4dd6bd61221ebc0bfb9350db333f.tiff\",  \n\"train_images/00412139e6b04d1e1cee8421f38f6e90.tiff\",  \n\"train_images/001d865e65ef5d2579c190a0e0350d8f.tiff\",  \n\"train_images/004f6b3a66189b4e88b6a01ba19d7d31.tiff\",  \n\"train_images/007433133235efc27a39f11df6940829.tiff\",  \n\"train_images/0032bfa835ce0f43a92ae0bbab6871cb.tiff\",  \n\"train_images/003046e27c8ead3e3db155780dc5498e.tiff\",  \n\"train_images/006f4d8d3556dd21f6424202c2d294a9.tiff\",  \n\"train_images/004391d48d58b18156f811087cd38abf.tiff\",  \n\"train_images/002a4db09dad406c85505a00fb6f6144.tiff\",  \n\"train_images/001c62abd11fa4b57bf7a6c603a11bb9.tiff\",  \n\"train_images/004dd32d9cd167d9cc31c13b704498af.tiff\",  \n\"train_images/006f6aa35a78965c92fffd1fbd53a058.tiff\",  \n\"train_images/0018ae58b01bdadc8e347995b69f99aa.tiff\",  \n\"train_images/003a91841da04a5a31f808fb5c21538a.tiff\",  \n\"train_images/0005f7aaab2800f6170c399693a96917.tiff\",  \n\"train_images/0068d4c7529e34fd4c9da863ce01a161.tiff\",  \n\"train_images/0076bcb66e46fb485f5ba432b9a1fe8a.tiff\",  \n\"train_images/000920ad0b612851f8e01bcc880d9b3d.tiff\",  \n\"train.csv\",  \n\"sample_submission.csv\",  \n\"test.csv\"]\n\n\nfor file in files:\n  !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n```",
      "votes": 1
    },
    {
      "id": 817076,
      "postDate": "2020-04-22T20:11:09.990Z",
      "content": "<p>The problem should now be resolved. Sorry for the hassle!</p>",
      "rawMarkdown": "The problem should now be resolved. Sorry for the hassle!",
      "votes": 2
    },
    {
      "id": 816966,
      "postDate": "2020-04-22T18:32:13.850Z",
      "content": "<p>v 1.5.6 is working now as expected.</p>",
      "rawMarkdown": "v 1.5.6 is working now as expected.",
      "votes": 2
    },
    {
      "id": 843372,
      "postDate": "2020-05-12T02:27:38.307Z",
      "content": "<p>When i run the following commands the result is only the 43 files that Emre Bayram listed. \nI dont know if that helps to diagnose the issue but this seems to indicate those are the only files recognised by the api. I am getting 404 errors on all of them though and im not sure why. </p>\n\n<p>import kaggle\nkaggle.api.competition_list_files('prostate-cancer-grade-assessment')</p>",
      "rawMarkdown": "When i run the following commands the result is only the 43 files that Emre Bayram listed. \nI dont know if that helps to diagnose the issue but this seems to indicate those are the only files recognised by the api. I am getting 404 errors on all of them though and im not sure why. \n\nimport kaggle\nkaggle.api.competition_list_files('prostate-cancer-grade-assessment')"
    },
    {
      "id": 816715,
      "postDate": "2020-04-22T14:30:13.210Z",
      "content": "<p>I downgraded the kaggle pip package to 1.5.3 and the 404 error has gone after that.</p>\n\n<p><code>pip install -U kaggle==1.5.3</code></p>\n\n<p>However I still can't download full dataset.</p>",
      "rawMarkdown": "I downgraded the kaggle pip package to 1.5.3 and the 404 error has gone after that.\n\n`pip install -U kaggle==1.5.3`\n\nHowever I still can't download full dataset."
    }
  ],
  "comments": [
    {
      "id": 816759,
      "author_name": "shago",
      "author_url": "",
      "post_date": "2020-04-22T15:06:11.017000",
      "content": "<p>Hi, I suffered the same thing.  I was able to downloaded cvs files and test files manually, but I couldn't download the training files.  Inspired by your solution  (thanks by the way, because I'd never used kaggle's API before) I made the following code:</p>\n\n<p><code>\ndef download_kaggle(train):\n    files = pd.read_csv(train)  # Read file with images data\n    files = 'train_images/' + files[\"image_id\"] + '.tiff' # Create an object that concatenate directory localization <br>\n                                                                        # and file extension with file name\n    for file in files:\n        !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n        time.sleep(10) # Pause the loop so that not too many download requests are \n                    # made and the files are not blocked from downloading\n</code></p>\n\n<p>Update: this code only download 20 files.  I trying to figure out how down load the remaining files</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 816678,
      "author_name": "Jon Macpherson",
      "author_url": "",
      "post_date": "2020-04-22T14:05:10.310000",
      "content": "<p>Trying out a variation of your code to get more of the files:</p>\n\n<p>`import pandas as pd\ntrain_df = pd.read_csv(\"train.csv\")</p>\n\n<p>for index, row in train_df.iterrows():\n    print(\"Id \", index, \"File\", row['image_id'])\n    #print(row['image_id'] + '.tiff') \n    tiff_zip_file = \"train_images/\" + row['image_id'] + '.tiff'\n    tiff_mask_file = \"train_label_masks/\" + row['image_id'] + '.tiff'\n    # Download the files.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_zip_file}\n    #Not every file has a mask, but try anyway.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_mask_file}\n    dest_tiff = 'train_images/' + row['image_id'] + '.tiff.zip'\n    dest_mask = 'mask_images/' + row['image_id'] + '.tiff.zip'\n    #Move the files into either train_images/ or mask_images/\n    !mv {row['image_id'] + '.tiff.zip'} {dest_tiff}\n    !mv {row['image_id'] + '.tiff.zip'} {dest_mask}\n    #unzip in destination folder\n    !unzip {dest_tiff} -d train_images/\n    !unzip {dest_mask} -d mask_images/\n    #remove original zips\n    !rm {dest_tiff}\n    !rm {dest_mask}`</p>\n\n<p>`</p>\n\n<p>Thanks for the template to work from!</p>\n\n<h1>works up until file 19.</h1>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 816326,
      "author_name": "Emre Bayram",
      "author_url": "",
      "post_date": "2020-04-22T09:25:20.387000",
      "content": "<p>I was able to download file by file:</p>\n\n<p>```\nfiles = [\n\"train_label_masks/00412139e6b04d1e1cee8421f38f6e90_mask.tiff\",\n\"train_label_masks/003a91841da04a5a31f808fb5c21538a_mask.tiff\",\n\"train_label_masks/002a4db09dad406c85505a00fb6f6144_mask.tiff\", <br>\n\"train_label_masks/006f4d8d3556dd21f6424202c2d294a9_mask.tiff\", \n\"train_label_masks/001c62abd11fa4b57bf7a6c603a11bb9_mask.tiff\",\n\"train_label_masks/007433133235efc27a39f11df6940829_mask.tiff\",\n\"train_label_masks/0005f7aaab2800f6170c399693a96917_mask.tiff\", <br>\n\"train_label_masks/000920ad0b612851f8e01bcc880d9b3d_mask.tiff\", <br>\n\"train_label_masks/0018ae58b01bdadc8e347995b69f99aa_mask.tiff\", <br>\n\"train_label_masks/006f6aa35a78965c92fffd1fbd53a058_mask.tiff\", <br>\n\"train_label_masks/003d4dd6bd61221ebc0bfb9350db333f_mask.tiff\", <br>\n\"train_label_masks/004dd32d9cd167d9cc31c13b704498af_mask.tiff\", <br>\n\"train_label_masks/0068d4c7529e34fd4c9da863ce01a161_mask.tiff\", <br>\n\"train_label_masks/005e66f06bce9c2e49142536caf2f6ee_mask.tiff\", <br>\n\"train_label_masks/004391d48d58b18156f811087cd38abf_mask.tiff\", <br>\n\"train_label_masks/003046e27c8ead3e3db155780dc5498e_mask.tiff\", <br>\n\"train_label_masks/001d865e65ef5d2579c190a0e0350d8f_mask.tiff\", <br>\n\"train_label_masks/0032bfa835ce0f43a92ae0bbab6871cb_mask.tiff\", <br>\n\"train_label_masks/004f6b3a66189b4e88b6a01ba19d7d31_mask.tiff\", <br>\n\"train_label_masks/0076bcb66e46fb485f5ba432b9a1fe8a_mask.tiff\", <br>\n\"train_images/005e66f06bce9c2e49142536caf2f6ee.tiff\", <br>\n\"train_images/003d4dd6bd61221ebc0bfb9350db333f.tiff\", <br>\n\"train_images/00412139e6b04d1e1cee8421f38f6e90.tiff\", <br>\n\"train_images/001d865e65ef5d2579c190a0e0350d8f.tiff\", <br>\n\"train_images/004f6b3a66189b4e88b6a01ba19d7d31.tiff\", <br>\n\"train_images/007433133235efc27a39f11df6940829.tiff\", <br>\n\"train_images/0032bfa835ce0f43a92ae0bbab6871cb.tiff\", <br>\n\"train_images/003046e27c8ead3e3db155780dc5498e.tiff\", <br>\n\"train_images/006f4d8d3556dd21f6424202c2d294a9.tiff\", <br>\n\"train_images/004391d48d58b18156f811087cd38abf.tiff\", <br>\n\"train_images/002a4db09dad406c85505a00fb6f6144.tiff\", <br>\n\"train_images/001c62abd11fa4b57bf7a6c603a11bb9.tiff\", <br>\n\"train_images/004dd32d9cd167d9cc31c13b704498af.tiff\", <br>\n\"train_images/006f6aa35a78965c92fffd1fbd53a058.tiff\", <br>\n\"train_images/0018ae58b01bdadc8e347995b69f99aa.tiff\", <br>\n\"train_images/003a91841da04a5a31f808fb5c21538a.tiff\", <br>\n\"train_images/0005f7aaab2800f6170c399693a96917.tiff\", <br>\n\"train_images/0068d4c7529e34fd4c9da863ce01a161.tiff\", <br>\n\"train_images/0076bcb66e46fb485f5ba432b9a1fe8a.tiff\", <br>\n\"train_images/000920ad0b612851f8e01bcc880d9b3d.tiff\", <br>\n\"train.csv\", <br>\n\"sample_submission.csv\", <br>\n\"test.csv\"]</p>\n\n<p>for file in files:\n  !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n```</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 817076,
      "author_name": "Sohier Dane",
      "author_url": "",
      "post_date": "2020-04-22T20:11:09.990000",
      "content": "<p>The problem should now be resolved. Sorry for the hassle!</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 816966,
      "author_name": "Emre Bayram",
      "author_url": "",
      "post_date": "2020-04-22T18:32:13.850000",
      "content": "<p>v 1.5.6 is working now as expected.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 843372,
      "author_name": "Edgar Cardenas ",
      "author_url": "",
      "post_date": "2020-05-12T02:27:38.307000",
      "content": "<p>When i run the following commands the result is only the 43 files that Emre Bayram listed. \nI dont know if that helps to diagnose the issue but this seems to indicate those are the only files recognised by the api. I am getting 404 errors on all of them though and im not sure why. </p>\n\n<p>import kaggle\nkaggle.api.competition_list_files('prostate-cancer-grade-assessment')</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 816715,
      "author_name": "Dmitry A. Grechka",
      "author_url": "",
      "post_date": "2020-04-22T14:30:13.210000",
      "content": "<p>I downgraded the kaggle pip package to 1.5.3 and the 404 error has gone after that.</p>\n\n<p><code>pip install -U kaggle==1.5.3</code></p>\n\n<p>However I still can't download full dataset.</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "816314": "I am getting 404 - Not found error while trying to download the data.\n`\n(base) emre@emre-desktop:~$ kaggle competitions download -c prostate-cancer-grade-assessment\n404 - Not Found\n`\n\nMy system:\nlocal jupyter server on Ubuntu\n\n- I have .kaggle/kaggle.json in my home folder.\n- I have installed kaggle api\n- I have tried both from command line and within jupyter notebook\n- I have accepted the competition rules\n- I have tried after restarting the notebook etc.\n\nAny idea?",
    "816759": "Hi, I suffered the same thing.  I was able to downloaded cvs files and test files manually, but I couldn't download the training files.  Inspired by your solution  (thanks by the way, because I'd never used kaggle's API before) I made the following code:\n\n```\ndef download_kaggle(train):\n    files = pd.read_csv(train)  # Read file with images data\n    files = 'train_images/' + files[\"image_id\"] + '.tiff' # Create an object that concatenate directory localization  \n                                                                        # and file extension with file name\n    for file in files:\n        !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n        time.sleep(10) # Pause the loop so that not too many download requests are \n                    # made and the files are not blocked from downloading\n```\n\nUpdate: this code only download 20 files.  I trying to figure out how down load the remaining files",
    "816678": "Trying out a variation of your code to get more of the files:\n\n`import pandas as pd\ntrain_df = pd.read_csv(\"train.csv\")\n\nfor index, row in train_df.iterrows():\n    print(\"Id \", index, \"File\", row['image_id'])\n    #print(row['image_id'] + '.tiff') \n    tiff_zip_file = \"train_images/\" + row['image_id'] + '.tiff'\n    tiff_mask_file = \"train_label_masks/\" + row['image_id'] + '.tiff'\n    # Download the files.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_zip_file}\n    #Not every file has a mask, but try anyway.\n    !kaggle competitions download prostate-cancer-grade-assessment -f {tiff_mask_file}\n    dest_tiff = 'train_images/' + row['image_id'] + '.tiff.zip'\n    dest_mask = 'mask_images/' + row['image_id'] + '.tiff.zip'\n    #Move the files into either train_images/ or mask_images/\n    !mv {row['image_id'] + '.tiff.zip'} {dest_tiff}\n    !mv {row['image_id'] + '.tiff.zip'} {dest_mask}\n    #unzip in destination folder\n    !unzip {dest_tiff} -d train_images/\n    !unzip {dest_mask} -d mask_images/\n    #remove original zips\n    !rm {dest_tiff}\n    !rm {dest_mask}`\n\n\n`\n\nThanks for the template to work from!\n\n# works up until file 19. ",
    "816326": "I was able to download file by file:\n\n```\nfiles = [\n\"train_label_masks/00412139e6b04d1e1cee8421f38f6e90_mask.tiff\",\n\"train_label_masks/003a91841da04a5a31f808fb5c21538a_mask.tiff\",\n\"train_label_masks/002a4db09dad406c85505a00fb6f6144_mask.tiff\",  \n\"train_label_masks/006f4d8d3556dd21f6424202c2d294a9_mask.tiff\", \n\"train_label_masks/001c62abd11fa4b57bf7a6c603a11bb9_mask.tiff\",\n\"train_label_masks/007433133235efc27a39f11df6940829_mask.tiff\",\n\"train_label_masks/0005f7aaab2800f6170c399693a96917_mask.tiff\",  \n\"train_label_masks/000920ad0b612851f8e01bcc880d9b3d_mask.tiff\",  \n\"train_label_masks/0018ae58b01bdadc8e347995b69f99aa_mask.tiff\",  \n\"train_label_masks/006f6aa35a78965c92fffd1fbd53a058_mask.tiff\",  \n\"train_label_masks/003d4dd6bd61221ebc0bfb9350db333f_mask.tiff\",  \n\"train_label_masks/004dd32d9cd167d9cc31c13b704498af_mask.tiff\",  \n\"train_label_masks/0068d4c7529e34fd4c9da863ce01a161_mask.tiff\",  \n\"train_label_masks/005e66f06bce9c2e49142536caf2f6ee_mask.tiff\",  \n\"train_label_masks/004391d48d58b18156f811087cd38abf_mask.tiff\",  \n\"train_label_masks/003046e27c8ead3e3db155780dc5498e_mask.tiff\",  \n\"train_label_masks/001d865e65ef5d2579c190a0e0350d8f_mask.tiff\",  \n\"train_label_masks/0032bfa835ce0f43a92ae0bbab6871cb_mask.tiff\",  \n\"train_label_masks/004f6b3a66189b4e88b6a01ba19d7d31_mask.tiff\",  \n\"train_label_masks/0076bcb66e46fb485f5ba432b9a1fe8a_mask.tiff\",  \n\"train_images/005e66f06bce9c2e49142536caf2f6ee.tiff\",  \n\"train_images/003d4dd6bd61221ebc0bfb9350db333f.tiff\",  \n\"train_images/00412139e6b04d1e1cee8421f38f6e90.tiff\",  \n\"train_images/001d865e65ef5d2579c190a0e0350d8f.tiff\",  \n\"train_images/004f6b3a66189b4e88b6a01ba19d7d31.tiff\",  \n\"train_images/007433133235efc27a39f11df6940829.tiff\",  \n\"train_images/0032bfa835ce0f43a92ae0bbab6871cb.tiff\",  \n\"train_images/003046e27c8ead3e3db155780dc5498e.tiff\",  \n\"train_images/006f4d8d3556dd21f6424202c2d294a9.tiff\",  \n\"train_images/004391d48d58b18156f811087cd38abf.tiff\",  \n\"train_images/002a4db09dad406c85505a00fb6f6144.tiff\",  \n\"train_images/001c62abd11fa4b57bf7a6c603a11bb9.tiff\",  \n\"train_images/004dd32d9cd167d9cc31c13b704498af.tiff\",  \n\"train_images/006f6aa35a78965c92fffd1fbd53a058.tiff\",  \n\"train_images/0018ae58b01bdadc8e347995b69f99aa.tiff\",  \n\"train_images/003a91841da04a5a31f808fb5c21538a.tiff\",  \n\"train_images/0005f7aaab2800f6170c399693a96917.tiff\",  \n\"train_images/0068d4c7529e34fd4c9da863ce01a161.tiff\",  \n\"train_images/0076bcb66e46fb485f5ba432b9a1fe8a.tiff\",  \n\"train_images/000920ad0b612851f8e01bcc880d9b3d.tiff\",  \n\"train.csv\",  \n\"sample_submission.csv\",  \n\"test.csv\"]\n\n\nfor file in files:\n  !kaggle competitions download prostate-cancer-grade-assessment -f {file}\n```",
    "817076": "The problem should now be resolved. Sorry for the hassle!",
    "816966": "v 1.5.6 is working now as expected.",
    "843372": "When i run the following commands the result is only the 43 files that Emre Bayram listed. \nI dont know if that helps to diagnose the issue but this seems to indicate those are the only files recognised by the api. I am getting 404 errors on all of them though and im not sure why. \n\nimport kaggle\nkaggle.api.competition_list_files('prostate-cancer-grade-assessment')",
    "816715": "I downgraded the kaggle pip package to 1.5.3 and the 404 error has gone after that.\n\n`pip install -U kaggle==1.5.3`\n\nHowever I still can't download full dataset."
  }
}