{
  "id": 384777,
  "title": "[solved] yet another submission scoring error?",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/384777",
  "author_name": "hengck23",
  "post_date": "2023-02-09T13:10:14.763000",
  "votes": 9,
  "comment_count": 12,
  "views": 0,
  "content": "<p>i checked all parts of the code and single out that only one line cause the bug:</p>\n<p><a href=\"https://ibb.co/WWG4JTd\"><img src=\"https://i.ibb.co/1f7tWSp/Selection-999-408.png\" alt=\"Selection-999-408\"></a></p>\n<p>anyone has any suggestion?</p>\n<p>probability = do_predict(net, test_df, test_gb) seems correct. it gives correct values on validation set on the kaggle notebook.</p>",
  "messages": [
    {
      "id": 2136637,
      "postDate": "2023-02-09T13:10:14.763Z",
      "content": "<p>i checked all parts of the code and single out that only one line cause the bug:</p>\n<p><a href=\"https://ibb.co/WWG4JTd\"><img src=\"https://i.ibb.co/1f7tWSp/Selection-999-408.png\" alt=\"Selection-999-408\"></a></p>\n<p>anyone has any suggestion?</p>\n<p>probability = do_predict(net, test_df, test_gb) seems correct. it gives correct values on validation set on the kaggle notebook.</p>",
      "rawMarkdown": "i checked all parts of the code and single out that only one line cause the bug:\n\n<a href=\"https://ibb.co/WWG4JTd\"><img src=\"https://i.ibb.co/1f7tWSp/Selection-999-408.png\" alt=\"Selection-999-408\" border=\"0\"></a>\n\nanyone has any suggestion?\n\nprobability = do_predict(net, test_df, test_gb) seems correct. it gives correct values on validation set on the kaggle notebook.",
      "votes": 9
    },
    {
      "id": 2137035,
      "postDate": "2023-02-09T17:27:17.897Z",
      "content": "<p>You could try to clip the probabilities <code>probability = np.clip(probability, 0, 1)</code>, and also make sure that <code>probability</code> is either a <code>list</code> or a one-dimensional numpy array.</p>",
      "rawMarkdown": "You could try to clip the probabilities `probability = np.clip(probability, 0, 1)`, and also make sure that `probability` is either a `list` or a one-dimensional numpy array.",
      "votes": 1
    },
    {
      "id": 2137835,
      "postDate": "2023-02-10T11:22:34.487Z",
      "content": "<p>I got \"Notebook Threw Exception\" in roi crop throught my debug. It is ok in local. I use the \"3hr tensorRT NextVIT example\" code.<br>\nCan you give me some tips?<br>\nThanks</p>",
      "rawMarkdown": "I got \"Notebook Threw Exception\" in roi crop throught my debug. It is ok in local. I use the \"3hr tensorRT NextVIT example\" code.\nCan you give me some tips?\nThanks",
      "replies": [
        {
          "id": 2137845,
          "postDate": "2023-02-10T11:27:30.363Z",
          "content": "<p>i think in the notebook comments i mention that you use use try and except to catch degenerate cases (i.e. no mask was detected)</p>",
          "rawMarkdown": "i think in the notebook comments i mention that you use use try and except to catch degenerate cases (i.e. no mask was detected)",
          "replies": [
            {
              "id": 2138037,
              "postDate": "2023-02-10T14:05:24.837Z",
              "content": "<p>It works. Thanks</p>",
              "rawMarkdown": "It works. Thanks"
            }
          ]
        }
      ]
    },
    {
      "id": 2137566,
      "postDate": "2023-02-10T06:28:41.583Z",
      "content": "<p>i solved the bug:</p>\n<ul>\n<li>this is becuase the laterality of the image are wrong. so when i preprocessing the image, i updated the laterality</li>\n<li>when submission, i forget to use the old laterality in the prediction id</li>\n</ul>",
      "rawMarkdown": "i solved the bug:\n- this is becuase the laterality of the image are wrong. so when i preprocessing the image, i updated the laterality\n- when submission, i forget to use the old laterality in the prediction id\n"
    },
    {
      "id": 2137531,
      "postDate": "2023-02-10T05:38:07.087Z",
      "content": "<p>Finally, you seem to try 2048x image size model !<br>\nI'll try it later too.</p>",
      "rawMarkdown": "Finally, you seem to try 2048x image size model !\nI'll try it later too.",
      "replies": [
        {
          "id": 2137573,
          "postDate": "2023-02-10T06:43:55.097Z",
          "content": "<p>no. it is still 1536. i tried 2048 previously and i think there is no significant improvement.<br>\nthe new submission is for multi-view fusion</p>\n<p>all my previous experiment had to be re-done (including the 2048). becuase the previous mean aggreation has a bug that i mentioned in other posts in the forum.</p>",
          "rawMarkdown": "no. it is still 1536. i tried 2048 previously and i think there is no significant improvement.\nthe new submission is for multi-view fusion\n\nall my previous experiment had to be re-done (including the 2048). becuase the previous mean aggreation has a bug that i mentioned in other posts in the forum."
        }
      ]
    },
    {
      "id": 2137053,
      "postDate": "2023-02-09T17:42:33.617Z",
      "content": "<p>from num_to_nan   <a href=\"https://numpy.org/doc/stable/reference/generated/numpy.common_type.html\" target=\"_blank\">https://numpy.org/doc/stable/reference/generated/numpy.common_type.html</a></p>\n<p>If x is not inexact, then no replacements are made.</p>\n<p>Maybe you have some dtypes in there?</p>",
      "rawMarkdown": "from num_to_nan   https://numpy.org/doc/stable/reference/generated/numpy.common_type.html\n\nIf x is not inexact, then no replacements are made.\n\nMaybe you have some dtypes in there?"
    },
    {
      "id": 2136678,
      "postDate": "2023-02-09T13:38:32.777Z",
      "content": "<p>Add try/except to suspicious areas.</p>",
      "rawMarkdown": "Add try/except to suspicious areas."
    },
    {
      "id": 2136650,
      "postDate": "2023-02-09T13:25:47.520Z",
      "content": "<p>\"Submission Scoring Error: Your notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected.\"</p>\n<ul>\n<li><p>wrong number of rows or columns<br>\nno possible, \"probability = np.random.uniform(0,1,len(test_gb))\" passes submission</p></li>\n<li><p>empty values, an incorrect data type for a value, or invalid submission values<br>\nnot possible, \"np.nan_to_num (probability , 0,0,0) #nan, posinf, neginf\" should catch allcases</p></li>\n</ul>",
      "rawMarkdown": "\"Submission Scoring Error: Your notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected.\"\n\n\n- wrong number of rows or columns\nno possible, \"probability = np.random.uniform(0,1,len(test_gb))\" passes submission\n\n-  empty values, an incorrect data type for a value, or invalid submission values\nnot possible, \"np.nan_to_num (probability , 0,0,0) #nan, posinf, neginf\" should catch allcases\n",
      "replies": [
        {
          "id": 2137043,
          "postDate": "2023-02-09T17:35:23.807Z",
          "content": "<p>Are you using half in inference?<br>\nTry to switch off and then sub. I do not know why but I got nan when had half during inference.</p>",
          "rawMarkdown": "Are you using half in inference?\nTry to switch off and then sub. I do not know why but I got nan when had half during inference."
        }
      ]
    },
    {
      "id": 2136643,
      "postDate": "2023-02-09T13:20:50.377Z",
      "content": "<p>it is probably an error just with very few cases, if you must, with every batch outputs, try to compute f1 score, if it fails, you know that batch is faulty, just replace all the model predictions with 0, it will hardly affect the score…</p>",
      "rawMarkdown": "it is probably an error just with very few cases, if you must, with every batch outputs, try to compute f1 score, if it fails, you know that batch is faulty, just replace all the model predictions with 0, it will hardly affect the score..."
    }
  ],
  "comments": [
    {
      "id": 2137035,
      "author_name": "Rasoul Mojtahedzadeh",
      "author_url": "",
      "post_date": "2023-02-09T17:27:17.897000",
      "content": "<p>You could try to clip the probabilities <code>probability = np.clip(probability, 0, 1)</code>, and also make sure that <code>probability</code> is either a <code>list</code> or a one-dimensional numpy array.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2137835,
      "author_name": "ynhuhu",
      "author_url": "",
      "post_date": "2023-02-10T11:22:34.487000",
      "content": "<p>I got \"Notebook Threw Exception\" in roi crop throught my debug. It is ok in local. I use the \"3hr tensorRT NextVIT example\" code.<br>\nCan you give me some tips?<br>\nThanks</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2137845,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-02-10T11:27:30.363000",
          "content": "<p>i think in the notebook comments i mention that you use use try and except to catch degenerate cases (i.e. no mask was detected)</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2138037,
              "author_name": "ynhuhu",
              "author_url": "",
              "post_date": "2023-02-10T14:05:24.837000",
              "content": "<p>It works. Thanks</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2137566,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-02-10T06:28:41.583000",
      "content": "<p>i solved the bug:</p>\n<ul>\n<li>this is becuase the laterality of the image are wrong. so when i preprocessing the image, i updated the laterality</li>\n<li>when submission, i forget to use the old laterality in the prediction id</li>\n</ul>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2137531,
      "author_name": "taruto",
      "author_url": "",
      "post_date": "2023-02-10T05:38:07.087000",
      "content": "<p>Finally, you seem to try 2048x image size model !<br>\nI'll try it later too.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2137573,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-02-10T06:43:55.097000",
          "content": "<p>no. it is still 1536. i tried 2048 previously and i think there is no significant improvement.<br>\nthe new submission is for multi-view fusion</p>\n<p>all my previous experiment had to be re-done (including the 2048). becuase the previous mean aggreation has a bug that i mentioned in other posts in the forum.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2137053,
      "author_name": "@kaggleqrdl",
      "author_url": "",
      "post_date": "2023-02-09T17:42:33.617000",
      "content": "<p>from num_to_nan   <a href=\"https://numpy.org/doc/stable/reference/generated/numpy.common_type.html\" target=\"_blank\">https://numpy.org/doc/stable/reference/generated/numpy.common_type.html</a></p>\n<p>If x is not inexact, then no replacements are made.</p>\n<p>Maybe you have some dtypes in there?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2136678,
      "author_name": "Gunes Evitan",
      "author_url": "",
      "post_date": "2023-02-09T13:38:32.777000",
      "content": "<p>Add try/except to suspicious areas.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2136650,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-02-09T13:25:47.520000",
      "content": "<p>\"Submission Scoring Error: Your notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected.\"</p>\n<ul>\n<li><p>wrong number of rows or columns<br>\nno possible, \"probability = np.random.uniform(0,1,len(test_gb))\" passes submission</p></li>\n<li><p>empty values, an incorrect data type for a value, or invalid submission values<br>\nnot possible, \"np.nan_to_num (probability , 0,0,0) #nan, posinf, neginf\" should catch allcases</p></li>\n</ul>",
      "votes": 0,
      "replies": [
        {
          "id": 2137043,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2023-02-09T17:35:23.807000",
          "content": "<p>Are you using half in inference?<br>\nTry to switch off and then sub. I do not know why but I got nan when had half during inference.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2136643,
      "author_name": "Harshit Sheoran",
      "author_url": "",
      "post_date": "2023-02-09T13:20:50.377000",
      "content": "<p>it is probably an error just with very few cases, if you must, with every batch outputs, try to compute f1 score, if it fails, you know that batch is faulty, just replace all the model predictions with 0, it will hardly affect the score…</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2136637": "i checked all parts of the code and single out that only one line cause the bug:\n\n<a href=\"https://ibb.co/WWG4JTd\"><img src=\"https://i.ibb.co/1f7tWSp/Selection-999-408.png\" alt=\"Selection-999-408\" border=\"0\"></a>\n\nanyone has any suggestion?\n\nprobability = do_predict(net, test_df, test_gb) seems correct. it gives correct values on validation set on the kaggle notebook.",
    "2137035": "You could try to clip the probabilities `probability = np.clip(probability, 0, 1)`, and also make sure that `probability` is either a `list` or a one-dimensional numpy array.",
    "2137835": "I got \"Notebook Threw Exception\" in roi crop throught my debug. It is ok in local. I use the \"3hr tensorRT NextVIT example\" code.\nCan you give me some tips?\nThanks",
    "2137566": "i solved the bug:\n- this is becuase the laterality of the image are wrong. so when i preprocessing the image, i updated the laterality\n- when submission, i forget to use the old laterality in the prediction id\n",
    "2137531": "Finally, you seem to try 2048x image size model !\nI'll try it later too.",
    "2137053": "from num_to_nan   https://numpy.org/doc/stable/reference/generated/numpy.common_type.html\n\nIf x is not inexact, then no replacements are made.\n\nMaybe you have some dtypes in there?",
    "2136678": "Add try/except to suspicious areas.",
    "2136650": "\"Submission Scoring Error: Your notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected.\"\n\n\n- wrong number of rows or columns\nno possible, \"probability = np.random.uniform(0,1,len(test_gb))\" passes submission\n\n-  empty values, an incorrect data type for a value, or invalid submission values\nnot possible, \"np.nan_to_num (probability , 0,0,0) #nan, posinf, neginf\" should catch allcases\n",
    "2136643": "it is probably an error just with very few cases, if you must, with every batch outputs, try to compute f1 score, if it fails, you know that batch is faulty, just replace all the model predictions with 0, it will hardly affect the score..."
  }
}