{
  "id": 165077,
  "title": "Submission not working, I tried everything",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/165077",
  "author_name": "Leslie Solorzano",
  "post_date": "2020-07-08T13:33:24.926000",
  "votes": 7,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Seems that submitting in kaggle is a bit cumbersome.</p>\n\n<p>I have followed all the instructions, and I don't understand how this keeps happening.\nI have read the <a href=\"https://www.kaggle.com/docs/competitions#kernels-only-FAQ\">Competition FAQ</a></p>\n\n<p>First I create a kernel.\nSave and run (commit)\nLook for the outputted submission.csv in the kernel view\nIt has only the 3 lines of the preview\nI still click submit</p>\n\n<p>I understand that the file is private so we should not see the Id's of the tests, so I assumed that the csv file created was the correct one. But I still get a -0.0 result. There is of course the possibility that the results are that bad... but in my tests I get quite high kappa-scores using all the train set, trying on millions of patches, so it cant be that bad.</p>\n\n<p>Can someone please point me in the right direction?</p>\n\n<p>There are nice notebooks that are done for like a simple submission, they usually have something like: </p>\n\n<p>```\nTEST_CSV = '/kaggle/input/prostate-cancer-grade-assessment/test.csv'\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'</p>\n\n<p>if os.path.exists(TEST_PATH):\n    subject_ids = list(pd.read_csv(TEST_CSV).image_id)</p>\n\n<pre><code>print(f\"length subject_ids: {len(subject_ids)}\")\n\npreds = []\nfor subject_id in subject_ids:\n    score = 0\n    preds.append(score)\n\nsub_df = pd.DataFrame({'image_id': subject_ids, 'isup_grade': preds})\nsub_df.to_csv('submission.csv', index=False)\nprint(sub_df.head())\n</code></pre>\n\n<p>```</p>\n\n<p>Which is what I am trying, with my models, I test in my own notebooks and things work, and as soon as I try to submit I get nothing, only the example submission.</p>\n\n<p>Can some of the experienced ones here help me out?</p>",
  "messages": [
    {
      "id": 920289,
      "postDate": "2020-07-08T13:33:24.927Z",
      "content": "<p>Seems that submitting in kaggle is a bit cumbersome.</p>\n\n<p>I have followed all the instructions, and I don't understand how this keeps happening.\nI have read the <a href=\"https://www.kaggle.com/docs/competitions#kernels-only-FAQ\">Competition FAQ</a></p>\n\n<p>First I create a kernel.\nSave and run (commit)\nLook for the outputted submission.csv in the kernel view\nIt has only the 3 lines of the preview\nI still click submit</p>\n\n<p>I understand that the file is private so we should not see the Id's of the tests, so I assumed that the csv file created was the correct one. But I still get a -0.0 result. There is of course the possibility that the results are that bad... but in my tests I get quite high kappa-scores using all the train set, trying on millions of patches, so it cant be that bad.</p>\n\n<p>Can someone please point me in the right direction?</p>\n\n<p>There are nice notebooks that are done for like a simple submission, they usually have something like: </p>\n\n<p>```\nTEST_CSV = '/kaggle/input/prostate-cancer-grade-assessment/test.csv'\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'</p>\n\n<p>if os.path.exists(TEST_PATH):\n    subject_ids = list(pd.read_csv(TEST_CSV).image_id)</p>\n\n<pre><code>print(f\"length subject_ids: {len(subject_ids)}\")\n\npreds = []\nfor subject_id in subject_ids:\n    score = 0\n    preds.append(score)\n\nsub_df = pd.DataFrame({'image_id': subject_ids, 'isup_grade': preds})\nsub_df.to_csv('submission.csv', index=False)\nprint(sub_df.head())\n</code></pre>\n\n<p>```</p>\n\n<p>Which is what I am trying, with my models, I test in my own notebooks and things work, and as soon as I try to submit I get nothing, only the example submission.</p>\n\n<p>Can some of the experienced ones here help me out?</p>",
      "rawMarkdown": "Seems that submitting in kaggle is a bit cumbersome.\n\nI have followed all the instructions, and I don't understand how this keeps happening.\nI have read the [Competition FAQ](https://www.kaggle.com/docs/competitions#kernels-only-FAQ)\n\nFirst I create a kernel.\nSave and run (commit)\nLook for the outputted submission.csv in the kernel view\nIt has only the 3 lines of the preview\nI still click submit\n\nI understand that the file is private so we should not see the Id's of the tests, so I assumed that the csv file created was the correct one. But I still get a -0.0 result. There is of course the possibility that the results are that bad... but in my tests I get quite high kappa-scores using all the train set, trying on millions of patches, so it cant be that bad.\n\nCan someone please point me in the right direction?\n\nThere are nice notebooks that are done for like a simple submission, they usually have something like: \n\n```\nTEST_CSV = '/kaggle/input/prostate-cancer-grade-assessment/test.csv'\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'\n\nif os.path.exists(TEST_PATH):\n    subject_ids = list(pd.read_csv(TEST_CSV).image_id)\n    \n    print(f\"length subject_ids: {len(subject_ids)}\")\n    \n    preds = []\n    for subject_id in subject_ids:\n        score = 0\n        preds.append(score)\n\n    sub_df = pd.DataFrame({'image_id': subject_ids, 'isup_grade': preds})\n    sub_df.to_csv('submission.csv', index=False)\n    print(sub_df.head())\n```\n\nWhich is what I am trying, with my models, I test in my own notebooks and things work, and as soon as I try to submit I get nothing, only the example submission.\n\nCan some of the experienced ones here help me out?",
      "votes": 6
    },
    {
      "id": 927604,
      "postDate": "2020-07-13T14:02:15.153Z",
      "content": "<p>I encountered this problem before, and I had to reduce the batch size to 2 and it worked from then, of course now I am having other problems submitting, this is a real pain in the ...... </p>",
      "rawMarkdown": "I encountered this problem before, and I had to reduce the batch size to 2 and it worked from then, of course now I am having other problems submitting, this is a real pain in the ...... ",
      "votes": 4
    },
    {
      "id": 920361,
      "postDate": "2020-07-08T14:38:59.697Z",
      "content": "<p><a href=\"/lesolorzanov\">@lesolorzanov</a> Try running the same kernel in draft mode with a subset of the train images to see if the submission.csv file is properly created with the ISUP grade column having different values instead of all of them being zero.</p>",
      "rawMarkdown": "@lesolorzanov Try running the same kernel in draft mode with a subset of the train images to see if the submission.csv file is properly created with the ISUP grade column having different values instead of all of them being zero.",
      "votes": 1,
      "replies": [
        {
          "id": 922986,
          "postDate": "2020-07-10T13:14:25.457Z",
          "content": "<p>Yes, thanks. I did that and the submission.csv looks fine. I guess it is a matter of not printing or calling some other functions. But it would be nice to know if there is any blacklist so we can avoid using functions that will make our notebooks fail.</p>",
          "rawMarkdown": "Yes, thanks. I did that and the submission.csv looks fine. I guess it is a matter of not printing or calling some other functions. But it would be nice to know if there is any blacklist so we can avoid using functions that will make our notebooks fail.",
          "votes": 1
        },
        {
          "id": 925183,
          "postDate": "2020-07-11T21:41:48.573Z",
          "content": "<p>Did you manage to fix that?\nWhat was the issue?</p>\n\n<p>I also have 0.0 score, while  submission.csv looks good (with varying scores) when I generate it for train_images.</p>",
          "rawMarkdown": "Did you manage to fix that?\nWhat was the issue?\n\nI also have 0.0 score, while  submission.csv looks good (with varying scores) when I generate it for train_images."
        },
        {
          "id": 925849,
          "postDate": "2020-07-12T10:49:17.057Z",
          "content": "<p>It's mostly about removing all the printing statements. As long as the only output is the submission csv it seems to work</p>",
          "rawMarkdown": "It's mostly about removing all the printing statements. As long as the only output is the submission csv it seems to work",
          "votes": 1
        }
      ]
    },
    {
      "id": 927190,
      "postDate": "2020-07-13T08:53:39.767Z",
      "content": "<p>Fixed that. In my case there was an error in tile extraction inside prediction script. The zoom level was slightly different. So the kappa was indeed 0.0 :-)</p>\n\n<p>After fixing zoom level everything is fine now.</p>",
      "rawMarkdown": "Fixed that. In my case there was an error in tile extraction inside prediction script. The zoom level was slightly different. So the kappa was indeed 0.0 :-)\n\nAfter fixing zoom level everything is fine now.",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 927604,
      "author_name": "TheStoneMX",
      "author_url": "",
      "post_date": "2020-07-13T14:02:15.153000",
      "content": "<p>I encountered this problem before, and I had to reduce the batch size to 2 and it worked from then, of course now I am having other problems submitting, this is a real pain in the ...... </p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 920361,
      "author_name": "Yovin Yahathugoda",
      "author_url": "",
      "post_date": "2020-07-08T14:38:59.697000",
      "content": "<p><a href=\"/lesolorzanov\">@lesolorzanov</a> Try running the same kernel in draft mode with a subset of the train images to see if the submission.csv file is properly created with the ISUP grade column having different values instead of all of them being zero.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 922986,
          "author_name": "Leslie Solorzano",
          "author_url": "",
          "post_date": "2020-07-10T13:14:25.457000",
          "content": "<p>Yes, thanks. I did that and the submission.csv looks fine. I guess it is a matter of not printing or calling some other functions. But it would be nice to know if there is any blacklist so we can avoid using functions that will make our notebooks fail.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 925183,
          "author_name": "Dmitry A. Grechka",
          "author_url": "",
          "post_date": "2020-07-11T21:41:48.573000",
          "content": "<p>Did you manage to fix that?\nWhat was the issue?</p>\n\n<p>I also have 0.0 score, while  submission.csv looks good (with varying scores) when I generate it for train_images.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 925849,
          "author_name": "Leslie Solorzano",
          "author_url": "",
          "post_date": "2020-07-12T10:49:17.057000",
          "content": "<p>It's mostly about removing all the printing statements. As long as the only output is the submission csv it seems to work</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 927190,
      "author_name": "Dmitry A. Grechka",
      "author_url": "",
      "post_date": "2020-07-13T08:53:39.767000",
      "content": "<p>Fixed that. In my case there was an error in tile extraction inside prediction script. The zoom level was slightly different. So the kappa was indeed 0.0 :-)</p>\n\n<p>After fixing zoom level everything is fine now.</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "920289": "Seems that submitting in kaggle is a bit cumbersome.\n\nI have followed all the instructions, and I don't understand how this keeps happening.\nI have read the [Competition FAQ](https://www.kaggle.com/docs/competitions#kernels-only-FAQ)\n\nFirst I create a kernel.\nSave and run (commit)\nLook for the outputted submission.csv in the kernel view\nIt has only the 3 lines of the preview\nI still click submit\n\nI understand that the file is private so we should not see the Id's of the tests, so I assumed that the csv file created was the correct one. But I still get a -0.0 result. There is of course the possibility that the results are that bad... but in my tests I get quite high kappa-scores using all the train set, trying on millions of patches, so it cant be that bad.\n\nCan someone please point me in the right direction?\n\nThere are nice notebooks that are done for like a simple submission, they usually have something like: \n\n```\nTEST_CSV = '/kaggle/input/prostate-cancer-grade-assessment/test.csv'\nTEST_PATH = '/kaggle/input/prostate-cancer-grade-assessment/test_images'\n\nif os.path.exists(TEST_PATH):\n    subject_ids = list(pd.read_csv(TEST_CSV).image_id)\n    \n    print(f\"length subject_ids: {len(subject_ids)}\")\n    \n    preds = []\n    for subject_id in subject_ids:\n        score = 0\n        preds.append(score)\n\n    sub_df = pd.DataFrame({'image_id': subject_ids, 'isup_grade': preds})\n    sub_df.to_csv('submission.csv', index=False)\n    print(sub_df.head())\n```\n\nWhich is what I am trying, with my models, I test in my own notebooks and things work, and as soon as I try to submit I get nothing, only the example submission.\n\nCan some of the experienced ones here help me out?",
    "927604": "I encountered this problem before, and I had to reduce the batch size to 2 and it worked from then, of course now I am having other problems submitting, this is a real pain in the ...... ",
    "920361": "@lesolorzanov Try running the same kernel in draft mode with a subset of the train images to see if the submission.csv file is properly created with the ISUP grade column having different values instead of all of them being zero.",
    "927190": "Fixed that. In my case there was an error in tile extraction inside prediction script. The zoom level was slightly different. So the kappa was indeed 0.0 :-)\n\nAfter fixing zoom level everything is fine now."
  }
}