{
  "id": 211323,
  "title": "Submission csv not found",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/211323",
  "author_name": "",
  "post_date": "2021-01-14T16:25:03.796002800Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Yes, this topic again.</p>\n<pre><code>net.eval()\ntest_transform = Compose([            \n            Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], max_pixel_value=255.0, p=1.0),\n            ToTensorV2(p=1.0),\n        ], p=1.)\n\nresult = []\nfor img in os.listdir(\"../input/cassava-leaf-disease-classification/test_images\"):\n    im = Image.open(\"../input/cassava-leaf-disease-classification/test_images/\" + img).convert(\"RGB\")\n    im = np.array(im)\n    im = test_transform(image=im)['image'].unsqueeze(0).to(device)\n    im_predict = torch.argmax(net(im)).item()\n    result.append([img, im_predict])\nsubmission = pd.DataFrame(result, columns = ['image_id', 'label'])\nsubmission.to_csv('submission.csv', index=False)\n</code></pre>\n<p>This is my last cell that handles the submission creation.<br>\nIt basically rolls through images in the /test_images/ folder, applies transforms and predicts labels which then get appended to the list. <br>\nI've checked my output, asserted that one-file submission is identical to sample submission, I tried to run it through the training data which has more images that test data to exclude memory related reasons and it works flawlessly, I created a second notebook that loads a finetuned model with no training process at all so it doesn't take long to run, but I still get this error.<br>\nI don't even know what else I could do here. Any advice?<br>\nBesides, submission \"tries\" get eaten up when you get this error, too, they didn't think this system through very well apparently.</p>",
  "messages": [
    {
      "id": "1153129",
      "postDate": "01/14/2021 16:25:03",
      "content": "<p>Yes, this topic again.</p>\n<pre><code>net.eval()\ntest_transform = Compose([            \n            Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], max_pixel_value=255.0, p=1.0),\n            ToTensorV2(p=1.0),\n        ], p=1.)\n\nresult = []\nfor img in os.listdir(\"../input/cassava-leaf-disease-classification/test_images\"):\n    im = Image.open(\"../input/cassava-leaf-disease-classification/test_images/\" + img).convert(\"RGB\")\n    im = np.array(im)\n    im = test_transform(image=im)['image'].unsqueeze(0).to(device)\n    im_predict = torch.argmax(net(im)).item()\n    result.append([img, im_predict])\nsubmission = pd.DataFrame(result, columns = ['image_id', 'label'])\nsubmission.to_csv('submission.csv', index=False)\n</code></pre>\n<p>This is my last cell that handles the submission creation.<br>\nIt basically rolls through images in the /test_images/ folder, applies transforms and predicts labels which then get appended to the list. <br>\nI've checked my output, asserted that one-file submission is identical to sample submission, I tried to run it through the training data which has more images that test data to exclude memory related reasons and it works flawlessly, I created a second notebook that loads a finetuned model with no training process at all so it doesn't take long to run, but I still get this error.<br>\nI don't even know what else I could do here. Any advice?<br>\nBesides, submission \"tries\" get eaten up when you get this error, too, they didn't think this system through very well apparently.</p>",
      "rawMarkdown": "Yes, this topic again.\n```\nnet.eval()\ntest_transform = Compose([            \n            Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], max_pixel_value=255.0, p=1.0),\n            ToTensorV2(p=1.0),\n        ], p=1.)\n\nresult = []\nfor img in os.listdir(\"../input/cassava-leaf-disease-classification/test_images\"):\n    im = Image.open(\"../input/cassava-leaf-disease-classification/test_images/\" + img).convert(\"RGB\")\n    im = np.array(im)\n    im = test_transform(image=im)['image'].unsqueeze(0).to(device)\n    im_predict = torch.argmax(net(im)).item()\n    result.append([img, im_predict])\nsubmission = pd.DataFrame(result, columns = ['image_id', 'label'])\nsubmission.to_csv('submission.csv', index=False)\n```\nThis is my last cell that handles the submission creation.\nIt basically rolls through images in the /test_images/ folder, applies transforms and predicts labels which then get appended to the list. \nI've checked my output, asserted that one-file submission is identical to sample submission, I tried to run it through the training data which has more images that test data to exclude memory related reasons and it works flawlessly, I created a second notebook that loads a finetuned model with no training process at all so it doesn't take long to run, but I still get this error.\nI don't even know what else I could do here. Any advice?\nBesides, submission \"tries\" get eaten up when you get this error, too, they didn't think this system through very well apparently.",
      "votes": null
    },
    {
      "id": "1159219",
      "postDate": "01/19/2021 05:30:50",
      "content": "<p>have u solve this problem yet?</p>",
      "rawMarkdown": "have u solve this problem yet?",
      "votes": null
    },
    {
      "id": "1159330",
      "postDate": "01/19/2021 07:39:44",
      "content": "<p>Yeah, for some reason in a competition that allows external data, internet for a notebook must be disabled. This warning didn't even appear at first.<br>\nI'm uploading trained models as datasets, and libs with pretrained models (such as timm) are out there in the datasets, uploaded by others, so I install them from those datasets as well.<br>\nSo in my case, installing certain libs which requires an internet connection was the problem.</p>",
      "rawMarkdown": "Yeah, for some reason in a competition that allows external data, internet for a notebook must be disabled. This warning didn't even appear at first.\nI'm uploading trained models as datasets, and libs with pretrained models (such as timm) are out there in the datasets, uploaded by others, so I install them from those datasets as well.\nSo in my case, installing certain libs which requires an internet connection was the problem.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1159219,
      "author_name": "allenggle",
      "author_url": "",
      "post_date": "01/19/2021 05:30:50",
      "content": "<p>have u solve this problem yet?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1159330,
      "author_name": "igordemidion",
      "author_url": "",
      "post_date": "01/19/2021 07:39:44",
      "content": "<p>Yeah, for some reason in a competition that allows external data, internet for a notebook must be disabled. This warning didn't even appear at first.<br>\nI'm uploading trained models as datasets, and libs with pretrained models (such as timm) are out there in the datasets, uploaded by others, so I install them from those datasets as well.<br>\nSo in my case, installing certain libs which requires an internet connection was the problem.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1153129": "Yes, this topic again.\n```\nnet.eval()\ntest_transform = Compose([            \n            Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], max_pixel_value=255.0, p=1.0),\n            ToTensorV2(p=1.0),\n        ], p=1.)\n\nresult = []\nfor img in os.listdir(\"../input/cassava-leaf-disease-classification/test_images\"):\n    im = Image.open(\"../input/cassava-leaf-disease-classification/test_images/\" + img).convert(\"RGB\")\n    im = np.array(im)\n    im = test_transform(image=im)['image'].unsqueeze(0).to(device)\n    im_predict = torch.argmax(net(im)).item()\n    result.append([img, im_predict])\nsubmission = pd.DataFrame(result, columns = ['image_id', 'label'])\nsubmission.to_csv('submission.csv', index=False)\n```\nThis is my last cell that handles the submission creation.\nIt basically rolls through images in the /test_images/ folder, applies transforms and predicts labels which then get appended to the list. \nI've checked my output, asserted that one-file submission is identical to sample submission, I tried to run it through the training data which has more images that test data to exclude memory related reasons and it works flawlessly, I created a second notebook that loads a finetuned model with no training process at all so it doesn't take long to run, but I still get this error.\nI don't even know what else I could do here. Any advice?\nBesides, submission \"tries\" get eaten up when you get this error, too, they didn't think this system through very well apparently.",
    "1159219": "have u solve this problem yet?",
    "1159330": "Yeah, for some reason in a competition that allows external data, internet for a notebook must be disabled. This warning didn't even appear at first.\nI'm uploading trained models as datasets, and libs with pretrained models (such as timm) are out there in the datasets, uploaded by others, so I install them from those datasets as well.\nSo in my case, installing certain libs which requires an internet connection was the problem."
  },
  "source": "meta"
}