{
  "id": 341175,
  "title": "Submission error scoring",
  "url": "/competitions/hubmap-organ-segmentation/discussion/341175",
  "author_name": "",
  "post_date": "2022-08-01T15:36:51.337038100Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi everyone !</p>\n<p>I need a powerful insight about my code. I keep having \"Submission Scoring Error\"… and I still haven't figured it out after one week 😁</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F54fa554bfdba7b63a380ca61d0f6af96%2FHUBMAP_image_1.png?generation=1659368146449011&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F75352e57cbdfcd3df2bdd0a2dd1b0ad5%2FHUBMAP_image_2.png?generation=1659368170583704&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F33e4c9c6ede71e2b28689ab20059a080%2FHUBMAP_image_3.png?generation=1659368196398821&amp;alt=media\" alt=\"\"></p>\n<p>Thanks </p>",
  "messages": [
    {
      "id": "1880293",
      "postDate": "08/01/2022 15:36:51",
      "content": "<p>Hi everyone !</p>\n<p>I need a powerful insight about my code. I keep having \"Submission Scoring Error\"… and I still haven't figured it out after one week 😁</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F54fa554bfdba7b63a380ca61d0f6af96%2FHUBMAP_image_1.png?generation=1659368146449011&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F75352e57cbdfcd3df2bdd0a2dd1b0ad5%2FHUBMAP_image_2.png?generation=1659368170583704&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F33e4c9c6ede71e2b28689ab20059a080%2FHUBMAP_image_3.png?generation=1659368196398821&amp;alt=media\" alt=\"\"></p>\n<p>Thanks </p>",
      "rawMarkdown": "Hi everyone !\n\nI need a powerful insight about my code. I keep having \"Submission Scoring Error\"... and I still haven't figured it out after one week 😁\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F54fa554bfdba7b63a380ca61d0f6af96%2FHUBMAP_image_1.png?generation=1659368146449011&alt=media)\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F75352e57cbdfcd3df2bdd0a2dd1b0ad5%2FHUBMAP_image_2.png?generation=1659368170583704&alt=media)\n\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F33e4c9c6ede71e2b28689ab20059a080%2FHUBMAP_image_3.png?generation=1659368196398821&alt=media)\n\nThanks",
      "votes": null
    },
    {
      "id": "1880478",
      "postDate": "08/01/2022 18:46:07",
      "content": "<p>I had the same problem as you, 2 weeks of errors \"Submission file not found\" and then \"Submission score error\". Now I know every corner case that can happen, so I can help you debug this stuff.</p>\n<p>In my case was the problem that RLE encoding had to be column wise, but I have encode it as row wise! I think that in testing dataset they have image that has different width and height so how you encode mask in RLE is important.</p>\n<p>I would first suggest that you try to put in CSV demo RLE… And you should get submission score 0.0</p>\n<pre><code>id,rle\n10044,1 1\n12345,1 1\n12305,1 1\n1345,1 1\n345,1 1\n...\n</code></pre>\n<p>When you successfuly get score 0.0 you will know that you write RLE for all testing images. Now you try to put the real RLE in, and if you get again submission error, its probably error in a way you encode RLE in your code.</p>\n<p>Use this code…<br>\nIn img.flatten you must say do you want column wise encoding or row wise encoding… <a href=\"https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html\" target=\"_blank\">numpy.ndarray.flatten</a></p>\n<pre><code>def encode_rle(img):\n    '''\n    img: numpy array, 1 - mask, 0 - background\n    Returns run length as string formated\n    '''\n    pixels = img.flatten(order=\"F\")\n    pixels = np.concatenate([[0], pixels, [0]])\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 1\n    runs[1::2] -= runs[:-1:2]\n    return ' '.join(str(x) for x in runs)\n</code></pre>",
      "rawMarkdown": "I had the same problem as you, 2 weeks of errors \"Submission file not found\" and then \"Submission score error\". Now I know every corner case that can happen, so I can help you debug this stuff.\n\nIn my case was the problem that RLE encoding had to be column wise, but I have encode it as row wise! I think that in testing dataset they have image that has different width and height so how you encode mask in RLE is important.\n\nI would first suggest that you try to put in CSV demo RLE... And you should get submission score 0.0\n\n```\nid,rle\n10044,1 1\n12345,1 1\n12305,1 1\n1345,1 1\n345,1 1\n...\n```\n\nWhen you successfuly get score 0.0 you will know that you write RLE for all testing images. Now you try to put the real RLE in, and if you get again submission error, its probably error in a way you encode RLE in your code.\n\nUse this code...\nIn img.flatten you must say do you want column wise encoding or row wise encoding... [numpy.ndarray.flatten](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html)\n\n```\ndef encode_rle(img):\n\t'''\n\timg: numpy array, 1 - mask, 0 - background\n\tReturns run length as string formated\n\t'''\n\tpixels = img.flatten(order=\"F\")\n\tpixels = np.concatenate([[0], pixels, [0]])\n\truns = np.where(pixels[1:] != pixels[:-1])[0] + 1\n\truns[1::2] -= runs[:-1:2]\n\treturn ' '.join(str(x) for x in runs)\n```",
      "votes": null
    },
    {
      "id": "1881108",
      "postDate": "08/02/2022 09:10:52",
      "content": "<p>Thanks, I will try it !</p>",
      "rawMarkdown": "Thanks, I will try it !",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1880478,
      "author_name": "urosjarc",
      "author_url": "",
      "post_date": "08/01/2022 18:46:07",
      "content": "<p>I had the same problem as you, 2 weeks of errors \"Submission file not found\" and then \"Submission score error\". Now I know every corner case that can happen, so I can help you debug this stuff.</p>\n<p>In my case was the problem that RLE encoding had to be column wise, but I have encode it as row wise! I think that in testing dataset they have image that has different width and height so how you encode mask in RLE is important.</p>\n<p>I would first suggest that you try to put in CSV demo RLE… And you should get submission score 0.0</p>\n<pre><code>id,rle\n10044,1 1\n12345,1 1\n12305,1 1\n1345,1 1\n345,1 1\n...\n</code></pre>\n<p>When you successfuly get score 0.0 you will know that you write RLE for all testing images. Now you try to put the real RLE in, and if you get again submission error, its probably error in a way you encode RLE in your code.</p>\n<p>Use this code…<br>\nIn img.flatten you must say do you want column wise encoding or row wise encoding… <a href=\"https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html\" target=\"_blank\">numpy.ndarray.flatten</a></p>\n<pre><code>def encode_rle(img):\n    '''\n    img: numpy array, 1 - mask, 0 - background\n    Returns run length as string formated\n    '''\n    pixels = img.flatten(order=\"F\")\n    pixels = np.concatenate([[0], pixels, [0]])\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 1\n    runs[1::2] -= runs[:-1:2]\n    return ' '.join(str(x) for x in runs)\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1881108,
      "author_name": "quentinmorelle",
      "author_url": "",
      "post_date": "08/02/2022 09:10:52",
      "content": "<p>Thanks, I will try it !</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1880293": "Hi everyone !\n\nI need a powerful insight about my code. I keep having \"Submission Scoring Error\"... and I still haven't figured it out after one week 😁\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F54fa554bfdba7b63a380ca61d0f6af96%2FHUBMAP_image_1.png?generation=1659368146449011&alt=media)\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F75352e57cbdfcd3df2bdd0a2dd1b0ad5%2FHUBMAP_image_2.png?generation=1659368170583704&alt=media)\n\n\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4488825%2F33e4c9c6ede71e2b28689ab20059a080%2FHUBMAP_image_3.png?generation=1659368196398821&alt=media)\n\nThanks",
    "1880478": "I had the same problem as you, 2 weeks of errors \"Submission file not found\" and then \"Submission score error\". Now I know every corner case that can happen, so I can help you debug this stuff.\n\nIn my case was the problem that RLE encoding had to be column wise, but I have encode it as row wise! I think that in testing dataset they have image that has different width and height so how you encode mask in RLE is important.\n\nI would first suggest that you try to put in CSV demo RLE... And you should get submission score 0.0\n\n```\nid,rle\n10044,1 1\n12345,1 1\n12305,1 1\n1345,1 1\n345,1 1\n...\n```\n\nWhen you successfuly get score 0.0 you will know that you write RLE for all testing images. Now you try to put the real RLE in, and if you get again submission error, its probably error in a way you encode RLE in your code.\n\nUse this code...\nIn img.flatten you must say do you want column wise encoding or row wise encoding... [numpy.ndarray.flatten](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html)\n\n```\ndef encode_rle(img):\n\t'''\n\timg: numpy array, 1 - mask, 0 - background\n\tReturns run length as string formated\n\t'''\n\tpixels = img.flatten(order=\"F\")\n\tpixels = np.concatenate([[0], pixels, [0]])\n\truns = np.where(pixels[1:] != pixels[:-1])[0] + 1\n\truns[1::2] -= runs[:-1:2]\n\treturn ' '.join(str(x) for x in runs)\n```",
    "1881108": "Thanks, I will try it !"
  },
  "source": "meta"
}