{
  "id": 170898,
  "title": "submit error，too cruel for beginners",
  "url": "/competitions/global-wheat-detection/discussion/170898",
  "author_name": "Fengjiedong",
  "post_date": "2020-07-29T13:14:56.301000",
  "votes": 2,
  "comment_count": 31,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2Fe7969fa204bd79852e439136f5349713%2FTIM20200729205441.png?generation=1596028076665424&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2F6a906633481f4e6c5ecdaeb7a9a17922%2FTIM20200729205450.png?generation=1596028080215112&amp;alt=media\" alt=\"\"></p>\n\n<p>I tried to submit my submissions many times, but all were errors. So I checked a lot of discussions, but did not come up with a good solution. I am really desperated, I just want a score that can appear.\nAt the same time, I saw a concept that I couldn't understand is the hidden data set. In the downloaded data, I only saw ten pictures, and each picture was a wheat ear. Why do some people say that certain rows in csv should be blank.\nAlthough these questions may be a bit stupid, I am very grateful to those who can reply to me.</p>",
  "messages": [
    {
      "id": 950872,
      "postDate": "2020-07-29T17:22:52.170Z",
      "content": "<p>I think the problem is most likely that the submission file does not contain rows for all the images in the hidden test set. You have to add the image_id with empty string even when the model doesnot predict any bounding boxes. It's possible that you missed some image_ids or you had multiple entries for the same image. I would double check how the submission file is created.</p>",
      "rawMarkdown": "I think the problem is most likely that the submission file does not contain rows for all the images in the hidden test set. You have to add the image\\_id with empty string even when the model doesnot predict any bounding boxes. It's possible that you missed some image\\_ids or you had multiple entries for the same image. I would double check how the submission file is created.",
      "votes": 4,
      "replies": [
        {
          "id": 950938,
          "postDate": "2020-07-29T18:29:29.830Z",
          "content": "<p>can not agree more</p>",
          "rawMarkdown": "can not agree more"
        },
        {
          "id": 951219,
          "postDate": "2020-07-30T02:00:16.583Z",
          "content": "<p>Thank you very much for your reply, because of the time difference, my reply is late. I uploaded my CSV, I hope you can help me look at the wrong place</p>",
          "rawMarkdown": "Thank you very much for your reply, because of the time difference, my reply is late. I uploaded my CSV, I hope you can help me look at the wrong place"
        },
        {
          "id": 951279,
          "postDate": "2020-07-30T03:15:24.787Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 955259,
          "postDate": "2020-08-02T13:55:13.997Z",
          "content": "<p>This is not true though, people just keep repeating it. You will not get any sort of submission error if you submit a file with missing rows. You can test that out by submitting the sample submission, which only has 10 columns, none of which are for empty images. If you submit that file you will not get a submission error of any kind. You will just get a very poor score (a 0.0009 to be precise).</p>",
          "rawMarkdown": "This is not true though, people just keep repeating it. You will not get any sort of submission error if you submit a file with missing rows. You can test that out by submitting the sample submission, which only has 10 columns, none of which are for empty images. If you submit that file you will not get a submission error of any kind. You will just get a very poor score (a 0.0009 to be precise)."
        }
      ]
    },
    {
      "id": 950551,
      "postDate": "2020-07-29T13:14:56.300Z",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2Fe7969fa204bd79852e439136f5349713%2FTIM20200729205441.png?generation=1596028076665424&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2F6a906633481f4e6c5ecdaeb7a9a17922%2FTIM20200729205450.png?generation=1596028080215112&amp;alt=media\" alt=\"\"></p>\n\n<p>I tried to submit my submissions many times, but all were errors. So I checked a lot of discussions, but did not come up with a good solution. I am really desperated, I just want a score that can appear.\nAt the same time, I saw a concept that I couldn't understand is the hidden data set. In the downloaded data, I only saw ten pictures, and each picture was a wheat ear. Why do some people say that certain rows in csv should be blank.\nAlthough these questions may be a bit stupid, I am very grateful to those who can reply to me.</p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2Fe7969fa204bd79852e439136f5349713%2FTIM20200729205441.png?generation=1596028076665424&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2F6a906633481f4e6c5ecdaeb7a9a17922%2FTIM20200729205450.png?generation=1596028080215112&amp;alt=media)\n\nI tried to submit my submissions many times, but all were errors. So I checked a lot of discussions, but did not come up with a good solution. I am really desperated, I just want a score that can appear.\nAt the same time, I saw a concept that I couldn't understand is the hidden data set. In the downloaded data, I only saw ten pictures, and each picture was a wheat ear. Why do some people say that certain rows in csv should be blank.\nAlthough these questions may be a bit stupid, I am very grateful to those who can reply to me.",
      "votes": 2
    },
    {
      "id": 950561,
      "postDate": "2020-07-29T13:20:32.777Z",
      "content": "<p>I never saw \"Submission Scoring Error\" in this competition, maybe you can publish your kernel, and let people debug it. At least, your submission running time (&lt; 13min) looks abnormal to me.</p>",
      "rawMarkdown": "I never saw \"Submission Scoring Error\" in this competition, maybe you can publish your kernel, and let people debug it. At least, your submission running time (&lt; 13min) looks abnormal to me.",
      "votes": 2,
      "replies": [
        {
          "id": 950618,
          "postDate": "2020-07-29T13:55:30.570Z",
          "content": "<p>I imported the sample model on my computer and retrain it. Only one CSV was submitted through the notebook, so it seemed that the time was very short. Is it because i need to train on kaggle to get results that can be submitted?The code, in fact, I copy from the high score notebook, I think it should not be the key problem. The result seems reasonable.</p>",
          "rawMarkdown": "I imported the sample model on my computer and retrain it. Only one CSV was submitted through the notebook, so it seemed that the time was very short. Is it because i need to train on kaggle to get results that can be submitted?The code, in fact, I copy from the high score notebook, I think it should not be the key problem. The result seems reasonable."
        },
        {
          "id": 950648,
          "postDate": "2020-07-29T14:15:41.523Z",
          "content": "<p>you don't have to train it. did you do anything modification on the notebook you copied? is there any if-else logic about the test set? like the number of test image? It sounds more about the inference. </p>",
          "rawMarkdown": "you don't have to train it. did you do anything modification on the notebook you copied? is there any if-else logic about the test set? like the number of test image? It sounds more about the inference. "
        },
        {
          "id": 950658,
          "postDate": "2020-07-29T14:23:25.367Z",
          "content": "<p>Thank you very much for your quick reply. No, at first, I used the fastrcnn provided. There was an error when I submitted it. I thought it was because the accuracy was too low, so I copied something else later. Shouldn't the submitted data be a CSV file with 1 + 10 lines? I'm not sure what other test sets are meant by some of the discussions.Isn't there only ten test pictures</p>",
          "rawMarkdown": "Thank you very much for your quick reply. No, at first, I used the fastrcnn provided. There was an error when I submitted it. I thought it was because the accuracy was too low, so I copied something else later. Shouldn't the submitted data be a CSV file with 1 + 10 lines? I'm not sure what other test sets are meant by some of the discussions.Isn't there only ten test pictures"
        },
        {
          "id": 950673,
          "postDate": "2020-07-29T14:31:43.020Z",
          "content": "<p>the 10 test pic are only for testing your code. there are 1000 pics for real testing (score on Leaderboard), you can see this on description <a href=\"https://www.kaggle.com/c/global-wheat-detection/overview/description\">https://www.kaggle.com/c/global-wheat-detection/overview/description</a>. Thus, when you choose the csv and click submit, it will trigger a submission run, it will be the same as your commit, the only difference is that the images in test folder will be 1000 images instead of 10 images. \nAlso, not all images are 1024*1024 in the 1000 images. But this should NOT be your issue here, if you failed because of this the error should be 'not submission csv', something like this.</p>",
          "rawMarkdown": "the 10 test pic are only for testing your code. there are 1000 pics for real testing (score on Leaderboard), you can see this on description https://www.kaggle.com/c/global-wheat-detection/overview/description. Thus, when you choose the csv and click submit, it will trigger a submission run, it will be the same as your commit, the only difference is that the images in test folder will be 1000 images instead of 10 images. \nAlso, not all images are 1024*1024 in the 1000 images. But this should NOT be your issue here, if you failed because of this the error should be 'not submission csv', something like this."
        },
        {
          "id": 950684,
          "postDate": "2020-07-29T14:39:46.033Z",
          "content": "<p>I remember I put a screenshot of my data in this discussion, but I didn't see it. I think the format of my CSV is similar to that of others. If it is convenient, I can send my CSV to you by email. I don't think it's in the wrong format.</p>",
          "rawMarkdown": "I remember I put a screenshot of my data in this discussion, but I didn't see it. I think the format of my CSV is similar to that of others. If it is convenient, I can send my CSV to you by email. I don't think it's in the wrong format."
        },
        {
          "id": 950723,
          "postDate": "2020-07-29T15:13:36.897Z",
          "content": "<p>I can see your csv screenshot , it looks in the right format</p>",
          "rawMarkdown": "I can see your csv screenshot , it looks in the right format"
        },
        {
          "id": 950758,
          "postDate": "2020-07-29T15:34:33.737Z",
          "content": "<p>In principle, even if the score is very low, it should appear. Thank you. It puzzles me. I just want to get a score first and then modify my code. Is it because my CSV are not generated from notebooks？</p>",
          "rawMarkdown": "In principle, even if the score is very low, it should appear. Thank you. It puzzles me. I just want to get a score first and then modify my code. Is it because my CSV are not generated from notebooks？"
        },
        {
          "id": 950836,
          "postDate": "2020-07-29T16:54:47.673Z",
          "content": "<p>When I have problem that CSV not generated from notebook, I got \"Submission CSV Not Found\", so, your CSV should be generated. It's hard to tell the issue without checking the code. So I will still suggest you to publish your kernel, and let people debug it. You can publish it without attaching your model as others did</p>",
          "rawMarkdown": "When I have problem that CSV not generated from notebook, I got \"Submission CSV Not Found\", so, your CSV should be generated. It's hard to tell the issue without checking the code. So I will still suggest you to publish your kernel, and let people debug it. You can publish it without attaching your model as others did"
        },
        {
          "id": 951220,
          "postDate": "2020-07-30T02:06:53.070Z",
          "content": "<p>Thank you for your many responses. I uploaded my code, I hope you will have time to look at it.</p>",
          "rawMarkdown": "Thank you for your many responses. I uploaded my code, I hope you will have time to look at it."
        },
        {
          "id": 951228,
          "postDate": "2020-07-30T02:15:01.157Z",
          "content": "<p>Can you do 2 experiments:\n1. try <code>boxes = boxes[scores &amp;gt;= detection_threshold].astype(np.int32)</code> to <code>boxes = boxes[scores &amp;gt;= detection_threshold].astype(np.int32).clip(min=0, max=1023)</code>\n2. set a lower detection_threshold, like 0.2, just for testing purpose</p>",
          "rawMarkdown": "Can you do 2 experiments:\n1. try `boxes = boxes[scores &gt;= detection_threshold].astype(np.int32)` to `boxes = boxes[scores &gt;= detection_threshold].astype(np.int32).clip(min=0, max=1023)`\n2. set a lower detection_threshold, like 0.2, just for testing purpose\n"
        },
        {
          "id": 951262,
          "postDate": "2020-07-30T02:50:33.660Z",
          "content": "<p>Thank you very much. Ahhhh, I tried the two methods you mentioned. Unfortunately, it still failed and got an error.Sad.</p>",
          "rawMarkdown": "Thank you very much. Ahhhh, I tried the two methods you mentioned. Unfortunately, it still failed and got an error.Sad."
        },
        {
          "id": 951269,
          "postDate": "2020-07-30T03:03:05.070Z",
          "content": "<p>Ok, after reading your code, I guess I find the problem:\n```\nclass WheatTestDataset(Dataset):</p>\n\n<pre><code>def __init__(self, dataframe, image_dir, transforms=None):\n    super().__init__()\n\n    self.image_ids = dataframe['image_id'].unique()\n    self.df = dataframe\n    self.image_dir = image_dir\n    self.transforms = transforms\n</code></pre>\n\n<p><code>\n</code>\ntest_df = pd.read_csv(f'{DIR_INPUT}/sample_submission.csv')\n<code>\n</code>\ntest_dataset = WheatTestDataset(test_df, DIR_TEST, get_test_transform())\n<code>\nhere, you use `sample_submission` to get the image_ids, it will give you the 10 images in CSV, but as we said, the submission is other 1000 images, please change \n</code>\nself.image_ids = dataframe['image_id'].unique()\n<code>\nto read from image file names, code like:\n</code>\nnp.array([path.split('/')[-1][:-4] for path in glob(f'{TEST_ROOT_PATH}/*.jpg')])\n```</p>",
          "rawMarkdown": "Ok, after reading your code, I guess I find the problem:\n```\nclass WheatTestDataset(Dataset):\n\n    def __init__(self, dataframe, image_dir, transforms=None):\n        super().__init__()\n\n        self.image_ids = dataframe['image_id'].unique()\n        self.df = dataframe\n        self.image_dir = image_dir\n        self.transforms = transforms\n```\n```\ntest_df = pd.read_csv(f'{DIR_INPUT}/sample_submission.csv')\n```\n```\ntest_dataset = WheatTestDataset(test_df, DIR_TEST, get_test_transform())\n```\nhere, you use `sample_submission` to get the image_ids, it will give you the 10 images in CSV, but as we said, the submission is other 1000 images, please change \n```\nself.image_ids = dataframe['image_id'].unique()\n```\nto read from image file names, code like:\n```\nnp.array([path.split('/')[-1][:-4] for path in glob(f'{TEST_ROOT_PATH}/*.jpg')])\n```\n"
        },
        {
          "id": 951283,
          "postDate": "2020-07-30T03:21:18.587Z",
          "content": "<p>also, you may need to remove \n<code>\nrecords = self.df[self.df['image_id'] == image_id]\n</code>\nin WheatTestDataset</p>",
          "rawMarkdown": "also, you may need to remove \n```\nrecords = self.df[self.df['image_id'] == image_id]\n```\nin WheatTestDataset"
        },
        {
          "id": 951562,
          "postDate": "2020-07-30T08:06:38.177Z",
          "content": "<p>Thanks again. I changed the code according to your suggestion, but it still doesn't seem to work. I have put my code on the notebook. Although this is a bit stupid, I still can’t understand the influence casued by the hidden part of the test set,or,in another word,what is the true format of csv need by this competition. To be honest, it seems a little difficult for me to understand. But anyway, your help is greatly appreciated</p>",
          "rawMarkdown": "Thanks again. I changed the code according to your suggestion, but it still doesn't seem to work. I have put my code on the notebook. Although this is a bit stupid, I still can’t understand the influence casued by the hidden part of the test set,or,in another word,what is the true format of csv need by this competition. To be honest, it seems a little difficult for me to understand. But anyway, your help is greatly appreciated"
        },
        {
          "id": 951674,
          "postDate": "2020-07-30T10:01:01.763Z",
          "content": "<p>can you share me your new notebook? And is it the same error?\nlet me explain in Chinese, which may work better for you:\n当你commit和submit的时候，kaggle都会跑一下kernel的代码，submit不是直接把你commit之后生成的csv提交出去的。你提交之后，它会再跑一次的你的代码，这次，test image的folder里的图片会从之前的10张变成～1000张。而sample_submission.csv是不会变的，所以你原来的code，在提交的时候只会生成一个和你commit的时候一样的csv, 这个“格式”就已经错了，因为你应该提交一个1000张的结果而不是10张。如果你按我的建议改的没错，那应该还有其他bug。\n关于你问到the influence casued by the hidden part of the test set：\n首先，这就是开发和上线的关系，上线时什么都可能发生\n1. 如果图片大小变了，他可能break your code\n2. 如果图片检测不出任何东西，如果你代码了没有考虑到，他可能导致你的 csv里没有那张照片的那一行，这也会导致你看到的报错。\n你现在的问题应该不是PredictionString的格式有什么问题，而是你的image_id那里不对，至少在你改之前是这个问题</p>",
          "rawMarkdown": "can you share me your new notebook? And is it the same error?\nlet me explain in Chinese, which may work better for you:\n当你commit和submit的时候，kaggle都会跑一下kernel的代码，submit不是直接把你commit之后生成的csv提交出去的。你提交之后，它会再跑一次的你的代码，这次，test image的folder里的图片会从之前的10张变成～1000张。而sample_submission.csv是不会变的，所以你原来的code，在提交的时候只会生成一个和你commit的时候一样的csv, 这个“格式”就已经错了，因为你应该提交一个1000张的结果而不是10张。如果你按我的建议改的没错，那应该还有其他bug。\n关于你问到the influence casued by the hidden part of the test set：\n首先，这就是开发和上线的关系，上线时什么都可能发生\n1. 如果图片大小变了，他可能break your code\n2. 如果图片检测不出任何东西，如果你代码了没有考虑到，他可能导致你的 csv里没有那张照片的那一行，这也会导致你看到的报错。\n你现在的问题应该不是PredictionString的格式有什么问题，而是你的image_id那里不对，至少在你改之前是这个问题",
          "votes": 1,
          "replies": [
            {
              "id": 953992,
              "postDate": "2020-08-01T09:45:52.453Z",
              "content": "<p>Hi <a href=\"/creatrol\">@creatrol</a> , just tried the trick you mentioned. Hope I can submit successfully...</p>",
              "rawMarkdown": "Hi @creatrol , just tried the trick you mentioned. Hope I can submit successfully..."
            }
          ]
        },
        {
          "id": 951695,
          "postDate": "2020-07-30T10:14:48.630Z",
          "content": "<p>Excuse me for being stupid. I think I know where the mistake is.This competition is not the same as the one I did for the purpose of education. The one you mentioned above should be completely correct. The error lies in the fact that there are only two lines of code in my submission notebook, which is simply to submit the generated CSV.And I will uploed my model later  and run the code which had changed read-test  function in my kernel.I'm sorry that  my laziness  casue this problem after your suggestion.Thank you again.</p>",
          "rawMarkdown": "Excuse me for being stupid. I think I know where the mistake is.This competition is not the same as the one I did for the purpose of education. The one you mentioned above should be completely correct. The error lies in the fact that there are only two lines of code in my submission notebook, which is simply to submit the generated CSV.And I will uploed my model later  and run the code which had changed read-test  function in my kernel.I'm sorry that  my laziness  casue this problem after your suggestion.Thank you again."
        },
        {
          "id": 951702,
          "postDate": "2020-07-30T10:20:30.267Z",
          "content": "<p>I see, yes, the purpose of  'code competition' is to make it more like a real world project. So you will face more problems like in real production. somehow, it's good for us</p>",
          "rawMarkdown": "I see, yes, the purpose of  'code competition' is to make it more like a real world project. So you will face more problems like in real production. somehow, it's good for us"
        }
      ]
    },
    {
      "id": 951303,
      "postDate": "2020-07-30T03:49:24.117Z",
      "content": "<p>try <a href=\"https://www.kaggle.com/c/global-wheat-detection/discussion/163750\">this</a></p>",
      "rawMarkdown": "try [this](https://www.kaggle.com/c/global-wheat-detection/discussion/163750)"
    },
    {
      "id": 951028,
      "postDate": "2020-07-29T20:26:35.207Z",
      "content": "<p>I had submission scoring error when I did not include images with 0 predicted wheat heads in the submission.csv file. You need to predict an empty string for them.</p>",
      "rawMarkdown": "I had submission scoring error when I did not include images with 0 predicted wheat heads in the submission.csv file. You need to predict an empty string for them.",
      "replies": [
        {
          "id": 951211,
          "postDate": "2020-07-30T01:54:11.637Z",
          "content": "<p>Please forgive my stupidity, but I really can't understand what you mean by 0 prediction. Among the ten test pictures I downloaded, none of them are empty. I have seen similar descriptions several times.</p>",
          "rawMarkdown": "Please forgive my stupidity, but I really can't understand what you mean by 0 prediction. Among the ten test pictures I downloaded, none of them are empty. I have seen similar descriptions several times."
        },
        {
          "id": 951229,
          "postDate": "2020-07-30T02:15:11.620Z",
          "content": "<p>This may hold true for those 10 test images but the full test dataset has many more images, some likely without wheat heads. Therefor in your code, you should use an if statement to find when no boxes are predicted. In this case you simply output an empty string as the \"PredictionString\".</p>",
          "rawMarkdown": "This may hold true for those 10 test images but the full test dataset has many more images, some likely without wheat heads. Therefor in your code, you should use an if statement to find when no boxes are predicted. In this case you simply output an empty string as the \"PredictionString\"."
        },
        {
          "id": 951239,
          "postDate": "2020-07-30T02:31:16.507Z",
          "content": "<p>in his code, he uses\n<code>\ndef format_prediction_string(boxes, scores):\n    pred_strings = []\n    for j in zip(scores, boxes):\n        pred_strings.append(\"{0:.4f} {1} {2} {3} {4}\".format(j[0], j[1][0], j[1][1], j[1][2], j[1][3]))\n    return \" \".join(pred_strings)\n</code>\nThus, it should return empty string for 0 prediction images.</p>",
          "rawMarkdown": "in his code, he uses\n```\ndef format_prediction_string(boxes, scores):\n    pred_strings = []\n    for j in zip(scores, boxes):\n        pred_strings.append(\"{0:.4f} {1} {2} {3} {4}\".format(j[0], j[1][0], j[1][1], j[1][2], j[1][3]))\n    return \" \".join(pred_strings)\n```\nThus, it should return empty string for 0 prediction images."
        },
        {
          "id": 956600,
          "postDate": "2020-08-03T16:09:05.200Z",
          "content": "<p>@jacob how to handle image size not 1024 when we use 1024. ?\n1) How we know which image is not 1024 so we rescale its prediction wrt to its original size ?\nLooking for a help thanks in advance</p>",
          "rawMarkdown": "@jacob how to handle image size not 1024 when we use 1024. ?\n1) How we know which image is not 1024 so we rescale its prediction wrt to its original size ?\nLooking for a help thanks in advance"
        },
        {
          "id": 956635,
          "postDate": "2020-08-03T16:44:52.067Z",
          "content": "<p>because there are only very few cases, so I didn't rescale its prediction wrt to its original size. But it maybe a good thing to try</p>",
          "rawMarkdown": "because there are only very few cases, so I didn't rescale its prediction wrt to its original size. But it maybe a good thing to try"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 950872,
      "author_name": "johnny",
      "author_url": "",
      "post_date": "2020-07-29T17:22:52.170000",
      "content": "<p>I think the problem is most likely that the submission file does not contain rows for all the images in the hidden test set. You have to add the image_id with empty string even when the model doesnot predict any bounding boxes. It's possible that you missed some image_ids or you had multiple entries for the same image. I would double check how the submission file is created.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 950938,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-29T18:29:29.830000",
          "content": "<p>can not agree more</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951219,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T02:00:16.583000",
          "content": "<p>Thank you very much for your reply, because of the time difference, my reply is late. I uploaded my CSV, I hope you can help me look at the wrong place</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951279,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-07-30T03:15:24.787000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 955259,
          "author_name": "Johannes Illerhaus",
          "author_url": "",
          "post_date": "2020-08-02T13:55:13.997000",
          "content": "<p>This is not true though, people just keep repeating it. You will not get any sort of submission error if you submit a file with missing rows. You can test that out by submitting the sample submission, which only has 10 columns, none of which are for empty images. If you submit that file you will not get a submission error of any kind. You will just get a very poor score (a 0.0009 to be precise).</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 950561,
      "author_name": "Jacob",
      "author_url": "",
      "post_date": "2020-07-29T13:20:32.777000",
      "content": "<p>I never saw \"Submission Scoring Error\" in this competition, maybe you can publish your kernel, and let people debug it. At least, your submission running time (&lt; 13min) looks abnormal to me.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 950618,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-29T13:55:30.570000",
          "content": "<p>I imported the sample model on my computer and retrain it. Only one CSV was submitted through the notebook, so it seemed that the time was very short. Is it because i need to train on kaggle to get results that can be submitted?The code, in fact, I copy from the high score notebook, I think it should not be the key problem. The result seems reasonable.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950648,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-29T14:15:41.523000",
          "content": "<p>you don't have to train it. did you do anything modification on the notebook you copied? is there any if-else logic about the test set? like the number of test image? It sounds more about the inference. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950658,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-29T14:23:25.367000",
          "content": "<p>Thank you very much for your quick reply. No, at first, I used the fastrcnn provided. There was an error when I submitted it. I thought it was because the accuracy was too low, so I copied something else later. Shouldn't the submitted data be a CSV file with 1 + 10 lines? I'm not sure what other test sets are meant by some of the discussions.Isn't there only ten test pictures</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950673,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-29T14:31:43.020000",
          "content": "<p>the 10 test pic are only for testing your code. there are 1000 pics for real testing (score on Leaderboard), you can see this on description <a href=\"https://www.kaggle.com/c/global-wheat-detection/overview/description\">https://www.kaggle.com/c/global-wheat-detection/overview/description</a>. Thus, when you choose the csv and click submit, it will trigger a submission run, it will be the same as your commit, the only difference is that the images in test folder will be 1000 images instead of 10 images. \nAlso, not all images are 1024*1024 in the 1000 images. But this should NOT be your issue here, if you failed because of this the error should be 'not submission csv', something like this.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950684,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-29T14:39:46.033000",
          "content": "<p>I remember I put a screenshot of my data in this discussion, but I didn't see it. I think the format of my CSV is similar to that of others. If it is convenient, I can send my CSV to you by email. I don't think it's in the wrong format.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950723,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-29T15:13:36.897000",
          "content": "<p>I can see your csv screenshot , it looks in the right format</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950758,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-29T15:34:33.737000",
          "content": "<p>In principle, even if the score is very low, it should appear. Thank you. It puzzles me. I just want to get a score first and then modify my code. Is it because my CSV are not generated from notebooks？</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 950836,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-29T16:54:47.673000",
          "content": "<p>When I have problem that CSV not generated from notebook, I got \"Submission CSV Not Found\", so, your CSV should be generated. It's hard to tell the issue without checking the code. So I will still suggest you to publish your kernel, and let people debug it. You can publish it without attaching your model as others did</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951220,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T02:06:53.070000",
          "content": "<p>Thank you for your many responses. I uploaded my code, I hope you will have time to look at it.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951228,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T02:15:01.157000",
          "content": "<p>Can you do 2 experiments:\n1. try <code>boxes = boxes[scores &amp;gt;= detection_threshold].astype(np.int32)</code> to <code>boxes = boxes[scores &amp;gt;= detection_threshold].astype(np.int32).clip(min=0, max=1023)</code>\n2. set a lower detection_threshold, like 0.2, just for testing purpose</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951262,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T02:50:33.660000",
          "content": "<p>Thank you very much. Ahhhh, I tried the two methods you mentioned. Unfortunately, it still failed and got an error.Sad.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951269,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T03:03:05.070000",
          "content": "<p>Ok, after reading your code, I guess I find the problem:\n```\nclass WheatTestDataset(Dataset):</p>\n\n<pre><code>def __init__(self, dataframe, image_dir, transforms=None):\n    super().__init__()\n\n    self.image_ids = dataframe['image_id'].unique()\n    self.df = dataframe\n    self.image_dir = image_dir\n    self.transforms = transforms\n</code></pre>\n\n<p><code>\n</code>\ntest_df = pd.read_csv(f'{DIR_INPUT}/sample_submission.csv')\n<code>\n</code>\ntest_dataset = WheatTestDataset(test_df, DIR_TEST, get_test_transform())\n<code>\nhere, you use `sample_submission` to get the image_ids, it will give you the 10 images in CSV, but as we said, the submission is other 1000 images, please change \n</code>\nself.image_ids = dataframe['image_id'].unique()\n<code>\nto read from image file names, code like:\n</code>\nnp.array([path.split('/')[-1][:-4] for path in glob(f'{TEST_ROOT_PATH}/*.jpg')])\n```</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951283,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T03:21:18.587000",
          "content": "<p>also, you may need to remove \n<code>\nrecords = self.df[self.df['image_id'] == image_id]\n</code>\nin WheatTestDataset</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951562,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T08:06:38.177000",
          "content": "<p>Thanks again. I changed the code according to your suggestion, but it still doesn't seem to work. I have put my code on the notebook. Although this is a bit stupid, I still can’t understand the influence casued by the hidden part of the test set,or,in another word,what is the true format of csv need by this competition. To be honest, it seems a little difficult for me to understand. But anyway, your help is greatly appreciated</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951674,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T10:01:01.763000",
          "content": "<p>can you share me your new notebook? And is it the same error?\nlet me explain in Chinese, which may work better for you:\n当你commit和submit的时候，kaggle都会跑一下kernel的代码，submit不是直接把你commit之后生成的csv提交出去的。你提交之后，它会再跑一次的你的代码，这次，test image的folder里的图片会从之前的10张变成～1000张。而sample_submission.csv是不会变的，所以你原来的code，在提交的时候只会生成一个和你commit的时候一样的csv, 这个“格式”就已经错了，因为你应该提交一个1000张的结果而不是10张。如果你按我的建议改的没错，那应该还有其他bug。\n关于你问到the influence casued by the hidden part of the test set：\n首先，这就是开发和上线的关系，上线时什么都可能发生\n1. 如果图片大小变了，他可能break your code\n2. 如果图片检测不出任何东西，如果你代码了没有考虑到，他可能导致你的 csv里没有那张照片的那一行，这也会导致你看到的报错。\n你现在的问题应该不是PredictionString的格式有什么问题，而是你的image_id那里不对，至少在你改之前是这个问题</p>",
          "votes": 1,
          "replies": [
            {
              "id": 953992,
              "author_name": "",
              "author_url": "",
              "post_date": "2020-08-01T09:45:52.453000",
              "content": "<p>Hi <a href=\"/creatrol\">@creatrol</a> , just tried the trick you mentioned. Hope I can submit successfully...</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 951695,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T10:14:48.630000",
          "content": "<p>Excuse me for being stupid. I think I know where the mistake is.This competition is not the same as the one I did for the purpose of education. The one you mentioned above should be completely correct. The error lies in the fact that there are only two lines of code in my submission notebook, which is simply to submit the generated CSV.And I will uploed my model later  and run the code which had changed read-test  function in my kernel.I'm sorry that  my laziness  casue this problem after your suggestion.Thank you again.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951702,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T10:20:30.267000",
          "content": "<p>I see, yes, the purpose of  'code competition' is to make it more like a real world project. So you will face more problems like in real production. somehow, it's good for us</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 951303,
      "author_name": "gzYou",
      "author_url": "",
      "post_date": "2020-07-30T03:49:24.117000",
      "content": "<p>try <a href=\"https://www.kaggle.com/c/global-wheat-detection/discussion/163750\">this</a></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 951028,
      "author_name": "Dezső Ribli",
      "author_url": "",
      "post_date": "2020-07-29T20:26:35.207000",
      "content": "<p>I had submission scoring error when I did not include images with 0 predicted wheat heads in the submission.csv file. You need to predict an empty string for them.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 951211,
          "author_name": "Fengjiedong",
          "author_url": "",
          "post_date": "2020-07-30T01:54:11.637000",
          "content": "<p>Please forgive my stupidity, but I really can't understand what you mean by 0 prediction. Among the ten test pictures I downloaded, none of them are empty. I have seen similar descriptions several times.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951229,
          "author_name": "Matt",
          "author_url": "",
          "post_date": "2020-07-30T02:15:11.620000",
          "content": "<p>This may hold true for those 10 test images but the full test dataset has many more images, some likely without wheat heads. Therefor in your code, you should use an if statement to find when no boxes are predicted. In this case you simply output an empty string as the \"PredictionString\".</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 951239,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-07-30T02:31:16.507000",
          "content": "<p>in his code, he uses\n<code>\ndef format_prediction_string(boxes, scores):\n    pred_strings = []\n    for j in zip(scores, boxes):\n        pred_strings.append(\"{0:.4f} {1} {2} {3} {4}\".format(j[0], j[1][0], j[1][1], j[1][2], j[1][3]))\n    return \" \".join(pred_strings)\n</code>\nThus, it should return empty string for 0 prediction images.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 956600,
          "author_name": "Jaideep",
          "author_url": "",
          "post_date": "2020-08-03T16:09:05.200000",
          "content": "<p>@jacob how to handle image size not 1024 when we use 1024. ?\n1) How we know which image is not 1024 so we rescale its prediction wrt to its original size ?\nLooking for a help thanks in advance</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 956635,
          "author_name": "Jacob",
          "author_url": "",
          "post_date": "2020-08-03T16:44:52.067000",
          "content": "<p>because there are only very few cases, so I didn't rescale its prediction wrt to its original size. But it maybe a good thing to try</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "950872": "I think the problem is most likely that the submission file does not contain rows for all the images in the hidden test set. You have to add the image\\_id with empty string even when the model doesnot predict any bounding boxes. It's possible that you missed some image\\_ids or you had multiple entries for the same image. I would double check how the submission file is created.",
    "950551": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2Fe7969fa204bd79852e439136f5349713%2FTIM20200729205441.png?generation=1596028076665424&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F4247933%2F6a906633481f4e6c5ecdaeb7a9a17922%2FTIM20200729205450.png?generation=1596028080215112&amp;alt=media)\n\nI tried to submit my submissions many times, but all were errors. So I checked a lot of discussions, but did not come up with a good solution. I am really desperated, I just want a score that can appear.\nAt the same time, I saw a concept that I couldn't understand is the hidden data set. In the downloaded data, I only saw ten pictures, and each picture was a wheat ear. Why do some people say that certain rows in csv should be blank.\nAlthough these questions may be a bit stupid, I am very grateful to those who can reply to me.",
    "950561": "I never saw \"Submission Scoring Error\" in this competition, maybe you can publish your kernel, and let people debug it. At least, your submission running time (&lt; 13min) looks abnormal to me.",
    "951303": "try [this](https://www.kaggle.com/c/global-wheat-detection/discussion/163750)",
    "951028": "I had submission scoring error when I did not include images with 0 predicted wheat heads in the submission.csv file. You need to predict an empty string for them."
  }
}