{
  "id": 215492,
  "title": "Weird accuracy of 0.139",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/215492",
  "author_name": "",
  "post_date": "2021-01-30T06:38:21.148411900Z",
  "votes": null,
  "comment_count": 19,
  "views": 0,
  "content": "<p>Hey kagglers,<br>\nFrom the past few days, I have been trying to submit  multiple models, but all of them are giving me a weird accuracy of 0.139 whereas they are doing fine when I validated on some part of trainset(I was doing kfold validation). I tried with efficientnets, ViT, but that figure seems to be constant for all these model on lb. Does anybody experienced such a thing while you are trying to submit. If so, do let me know how you fixed it!<br>\nThanks you in advance!</p>",
  "messages": [
    {
      "id": "1177242",
      "postDate": "01/30/2021 06:38:21",
      "content": "<p>Hey kagglers,<br>\nFrom the past few days, I have been trying to submit  multiple models, but all of them are giving me a weird accuracy of 0.139 whereas they are doing fine when I validated on some part of trainset(I was doing kfold validation). I tried with efficientnets, ViT, but that figure seems to be constant for all these model on lb. Does anybody experienced such a thing while you are trying to submit. If so, do let me know how you fixed it!<br>\nThanks you in advance!</p>",
      "rawMarkdown": "Hey kagglers,\nFrom the past few days, I have been trying to submit  multiple models, but all of them are giving me a weird accuracy of 0.139 whereas they are doing fine when I validated on some part of trainset(I was doing kfold validation). I tried with efficientnets, ViT, but that figure seems to be constant for all these model on lb. Does anybody experienced such a thing while you are trying to submit. If so, do let me know how you fixed it!\nThanks you in advance!",
      "votes": null
    },
    {
      "id": "1177342",
      "postDate": "01/30/2021 08:08:46",
      "content": "<p>Debug your inference kernel, I had this error in the beginning, and it was due to a bad indentation in my inference method. </p>",
      "rawMarkdown": "Debug your inference kernel, I had this error in the beginning, and it was due to a bad indentation in my inference method.",
      "votes": null
    },
    {
      "id": "1177343",
      "postDate": "01/30/2021 08:09:36",
      "content": "<p>Hello!</p>\n<p>According to this <strong><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202943\" target=\"_blank\">class distribution</a></strong> of the public test set, it seems that your model mostly predicts label 4. I suppose you've just forgotten to normalize the test set before calling <code>predict</code> on it.</p>",
      "rawMarkdown": "Hello!\n\nAccording to this **[class distribution](https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202943)** of the public test set, it seems that your model mostly predicts label 4. I suppose you've just forgotten to normalize the test set before calling `predict` on it.",
      "votes": null
    },
    {
      "id": "1177362",
      "postDate": "01/30/2021 08:26:30",
      "content": "<p>hey <a href=\"https://www.kaggle.com/nickuzmenkov\" target=\"_blank\">@nickuzmenkov</a> , thanks for your reply,<br>\nBut I don't think my model is biased towards to label 4, because it's predicting label 2 for the one single image we got in test dataset. Moreover, my albumentation pipeline includes normalization as well. If possible have a look at my kernel <a href=\"https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627\" target=\"_blank\">here</a>.</p>",
      "rawMarkdown": "hey @nickuzmenkov , thanks for your reply,\nBut I don't think my model is biased towards to label 4, because it's predicting label 2 for the one single image we got in test dataset. Moreover, my albumentation pipeline includes normalization as well. If possible have a look at my kernel [here](https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627).",
      "votes": null
    },
    {
      "id": "1177364",
      "postDate": "01/30/2021 08:28:55",
      "content": "<p>I have thoroughly checked it but yet didn't find any such issues!<br>\nIf possible, have a look at it <a href=\"https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627\" target=\"_blank\">here</a></p>",
      "rawMarkdown": "I have thoroughly checked it but yet didn't find any such issues!\nIf possible, have a look at it [here](https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627)",
      "votes": null
    },
    {
      "id": "1177379",
      "postDate": "01/30/2021 08:37:24",
      "content": "<p>Getting a 404</p>",
      "rawMarkdown": "Getting a 404",
      "votes": null
    },
    {
      "id": "1177381",
      "postDate": "01/30/2021 08:37:57",
      "content": "<p>Thanks for sharing, <a href=\"https://www.kaggle.com/saimanojakondi\" target=\"_blank\">@saimanojakondi</a> <br>\nHowever, the link is broken</p>",
      "rawMarkdown": "Thanks for sharing, @saimanojakondi \nHowever, the link is broken",
      "votes": null
    },
    {
      "id": "1177384",
      "postDate": "01/30/2021 08:43:35",
      "content": "<p>apologies,<br>\ntry this <a href=\"https://www.kaggle.com/saimanojakondi/inference\" target=\"_blank\">one</a>.</p>",
      "rawMarkdown": "apologies,\ntry this [one](https://www.kaggle.com/saimanojakondi/inference).",
      "votes": null
    },
    {
      "id": "1177385",
      "postDate": "01/30/2021 08:44:00",
      "content": "<p>apologies,<br>\ntry this <a href=\"https://www.kaggle.com/saimanojakondi/inference\" target=\"_blank\">one</a></p>",
      "rawMarkdown": "apologies,\ntry this [one](https://www.kaggle.com/saimanojakondi/inference)",
      "votes": null
    },
    {
      "id": "1177433",
      "postDate": "01/30/2021 09:28:53",
      "content": "<p>Did you read this post?</p>\n<p><a href=\"url\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/212455</a></p>\n<p>Will look at your model shortly but 139 seems to be a score when your model does no predicting.</p>",
      "rawMarkdown": "Did you read this post?\n\n[https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/212455](url)\n\nWill look at your model shortly but 139 seems to be a score when your model does no predicting.",
      "votes": null
    },
    {
      "id": "1177446",
      "postDate": "01/30/2021 09:38:09",
      "content": "<p>I forked your model - since you have private data for the model file, it of course fails for me with this error. (YES YES - I know it should fail when I run it)</p>\n<p><code>FileNotFoundError: [Errno 2] No such file or directory: '../input/effnetb4/vit_large_patch16_384_best_fold1.pth'</code></p>\n<p>But guess what value I predicted for the single test image - yep a big old 2.</p>\n<p>Your generating some type of similar error.</p>",
      "rawMarkdown": "I forked your model - since you have private data for the model file, it of course fails for me with this error. (YES YES - I know it should fail when I run it)\n\n`FileNotFoundError: [Errno 2] No such file or directory: '../input/effnetb4/vit_large_patch16_384_best_fold1.pth'`\n\nBut guess what value I predicted for the single test image - yep a big old 2.\n\nYour generating some type of similar error.",
      "votes": null
    },
    {
      "id": "1177469",
      "postDate": "01/30/2021 09:55:35",
      "content": "<p>Thanks for sharing the thread, I had a similar doubt whether my model is predicting or not, so i ran the same inference kernel on few images of train data…model is predicting those properly.</p>",
      "rawMarkdown": "Thanks for sharing the thread, I had a similar doubt whether my model is predicting or not, so i ran the same inference kernel on few images of train data...model is predicting those properly.",
      "votes": null
    },
    {
      "id": "1177509",
      "postDate": "01/30/2021 10:27:05",
      "content": "<p>You should be getting 0 i hope….because i tried commenting out the line which is loading the weights and tried to predict and I got 0 as my label, anyways let me check it again ;)<br>\nBut still, it didn't understand why model is not predicting, like the code is pretty much straight forward</p>",
      "rawMarkdown": "You should be getting 0 i hope....because i tried commenting out the line which is loading the weights and tried to predict and I got 0 as my label, anyways let me check it again ;)\nBut still, it didn't understand why model is not predicting, like the code is pretty much straight forward",
      "votes": null
    },
    {
      "id": "1177560",
      "postDate": "01/30/2021 11:27:29",
      "content": "<p>There probably a nice long list of things that kill the model on a submit that don’t kill it during a commit.   How long after you submit can you view the submission score?   Should be several hours.   </p>",
      "rawMarkdown": "There probably a nice long list of things that kill the model on a submit that don’t kill it during a commit.   How long after you submit can you view the submission score?   Should be several hours.",
      "votes": null
    },
    {
      "id": "1177579",
      "postDate": "01/30/2021 11:47:37",
      "content": "<p>😂that's one more tricky thing here, it took couple of mins(&lt;60) to get the score on lb</p>",
      "rawMarkdown": "😂that's one more tricky thing here, it took couple of mins(<60) to get the score on lb",
      "votes": null
    },
    {
      "id": "1178059",
      "postDate": "01/30/2021 16:22:44",
      "content": "<p>Don't due Pytorch so not able to read the code and don't have a Pytorch model that I could use in place of your private.  </p>\n<p>I would use GPU rather than cpu - was the model trained with GPU?  Pretty sure it's an error loading the model or killing it early.</p>",
      "rawMarkdown": "Don't due Pytorch so not able to read the code and don't have a Pytorch model that I could use in place of your private.  \n\nI would use GPU rather than cpu - was the model trained with GPU?  Pretty sure it's an error loading the model or killing it early.",
      "votes": null
    },
    {
      "id": "1178174",
      "postDate": "01/30/2021 17:45:27",
      "content": "<p>yes the model is trained on GPU…If it's due to loading it should not predict stuff while committing the kernel also, isn't it?</p>",
      "rawMarkdown": "yes the model is trained on GPU...If it's due to loading it should not predict stuff while committing the kernel also, isn't it?",
      "votes": null
    },
    {
      "id": "1178365",
      "postDate": "01/30/2021 20:21:44",
      "content": "<p>When I had my error that predicted 0.139 I had attempted to run a model I had not loaded - so something gets written to a submission file with the hidden test process even if no model existing  - if you trained on GPU I would submit with GPU turned on and change the right code for GPU predicting.  </p>",
      "rawMarkdown": "When I had my error that predicted 0.139 I had attempted to run a model I had not loaded - so something gets written to a submission file with the hidden test process even if no model existing  - if you trained on GPU I would submit with GPU turned on and change the right code for GPU predicting.",
      "votes": null
    },
    {
      "id": "1178932",
      "postDate": "01/31/2021 07:36:17",
      "content": "<p>Just now, I tried with a tpu model and it took lot of time…finally a big notebook timed out error!!😂</p>",
      "rawMarkdown": "Just now, I tried with a tpu model and it took lot of time...finally a big notebook timed out error!!😂",
      "votes": null
    },
    {
      "id": "1179125",
      "postDate": "01/31/2021 10:42:52",
      "content": "<p>Whats that saying about 1 step forward and 2 steps back ?  Good luck 👍👍👍</p>",
      "rawMarkdown": "Whats that saying about 1 step forward and 2 steps back ?  Good luck 👍👍👍",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1177342,
      "author_name": "zowlex",
      "author_url": "",
      "post_date": "01/30/2021 08:08:46",
      "content": "<p>Debug your inference kernel, I had this error in the beginning, and it was due to a bad indentation in my inference method. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1177364,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 08:28:55",
          "content": "<p>I have thoroughly checked it but yet didn't find any such issues!<br>\nIf possible, have a look at it <a href=\"https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627\" target=\"_blank\">here</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177379,
          "author_name": "mithilsalunkhe",
          "author_url": "",
          "post_date": "01/30/2021 08:37:24",
          "content": "<p>Getting a 404</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177385,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 08:44:00",
          "content": "<p>apologies,<br>\ntry this <a href=\"https://www.kaggle.com/saimanojakondi/inference\" target=\"_blank\">one</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1177343,
      "author_name": "nickuzmenkov",
      "author_url": "",
      "post_date": "01/30/2021 08:09:36",
      "content": "<p>Hello!</p>\n<p>According to this <strong><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202943\" target=\"_blank\">class distribution</a></strong> of the public test set, it seems that your model mostly predicts label 4. I suppose you've just forgotten to normalize the test set before calling <code>predict</code> on it.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1177362,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 08:26:30",
          "content": "<p>hey <a href=\"https://www.kaggle.com/nickuzmenkov\" target=\"_blank\">@nickuzmenkov</a> , thanks for your reply,<br>\nBut I don't think my model is biased towards to label 4, because it's predicting label 2 for the one single image we got in test dataset. Moreover, my albumentation pipeline includes normalization as well. If possible have a look at my kernel <a href=\"https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627\" target=\"_blank\">here</a>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177381,
          "author_name": "nickuzmenkov",
          "author_url": "",
          "post_date": "01/30/2021 08:37:57",
          "content": "<p>Thanks for sharing, <a href=\"https://www.kaggle.com/saimanojakondi\" target=\"_blank\">@saimanojakondi</a> <br>\nHowever, the link is broken</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177384,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 08:43:35",
          "content": "<p>apologies,<br>\ntry this <a href=\"https://www.kaggle.com/saimanojakondi/inference\" target=\"_blank\">one</a>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1177433,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "01/30/2021 09:28:53",
      "content": "<p>Did you read this post?</p>\n<p><a href=\"url\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/212455</a></p>\n<p>Will look at your model shortly but 139 seems to be a score when your model does no predicting.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1177469,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 09:55:35",
          "content": "<p>Thanks for sharing the thread, I had a similar doubt whether my model is predicting or not, so i ran the same inference kernel on few images of train data…model is predicting those properly.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1177446,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "01/30/2021 09:38:09",
      "content": "<p>I forked your model - since you have private data for the model file, it of course fails for me with this error. (YES YES - I know it should fail when I run it)</p>\n<p><code>FileNotFoundError: [Errno 2] No such file or directory: '../input/effnetb4/vit_large_patch16_384_best_fold1.pth'</code></p>\n<p>But guess what value I predicted for the single test image - yep a big old 2.</p>\n<p>Your generating some type of similar error.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1177509,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 10:27:05",
          "content": "<p>You should be getting 0 i hope….because i tried commenting out the line which is loading the weights and tried to predict and I got 0 as my label, anyways let me check it again ;)<br>\nBut still, it didn't understand why model is not predicting, like the code is pretty much straight forward</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177560,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "01/30/2021 11:27:29",
          "content": "<p>There probably a nice long list of things that kill the model on a submit that don’t kill it during a commit.   How long after you submit can you view the submission score?   Should be several hours.   </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1177579,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 11:47:37",
          "content": "<p>😂that's one more tricky thing here, it took couple of mins(&lt;60) to get the score on lb</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1178059,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "01/30/2021 16:22:44",
          "content": "<p>Don't due Pytorch so not able to read the code and don't have a Pytorch model that I could use in place of your private.  </p>\n<p>I would use GPU rather than cpu - was the model trained with GPU?  Pretty sure it's an error loading the model or killing it early.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1178174,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/30/2021 17:45:27",
          "content": "<p>yes the model is trained on GPU…If it's due to loading it should not predict stuff while committing the kernel also, isn't it?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1178365,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "01/30/2021 20:21:44",
          "content": "<p>When I had my error that predicted 0.139 I had attempted to run a model I had not loaded - so something gets written to a submission file with the hidden test process even if no model existing  - if you trained on GPU I would submit with GPU turned on and change the right code for GPU predicting.  </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1178932,
          "author_name": "saimanojakondi",
          "author_url": "",
          "post_date": "01/31/2021 07:36:17",
          "content": "<p>Just now, I tried with a tpu model and it took lot of time…finally a big notebook timed out error!!😂</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1179125,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "01/31/2021 10:42:52",
          "content": "<p>Whats that saying about 1 step forward and 2 steps back ?  Good luck 👍👍👍</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1177242": "Hey kagglers,\nFrom the past few days, I have been trying to submit  multiple models, but all of them are giving me a weird accuracy of 0.139 whereas they are doing fine when I validated on some part of trainset(I was doing kfold validation). I tried with efficientnets, ViT, but that figure seems to be constant for all these model on lb. Does anybody experienced such a thing while you are trying to submit. If so, do let me know how you fixed it!\nThanks you in advance!",
    "1177342": "Debug your inference kernel, I had this error in the beginning, and it was due to a bad indentation in my inference method.",
    "1177343": "Hello!\n\nAccording to this **[class distribution](https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202943)** of the public test set, it seems that your model mostly predicts label 4. I suppose you've just forgotten to normalize the test set before calling `predict` on it.",
    "1177362": "hey @nickuzmenkov , thanks for your reply,\nBut I don't think my model is biased towards to label 4, because it's predicting label 2 for the one single image we got in test dataset. Moreover, my albumentation pipeline includes normalization as well. If possible have a look at my kernel [here](https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627).",
    "1177364": "I have thoroughly checked it but yet didn't find any such issues!\nIf possible, have a look at it [here](https://www.kaggle.com/saimanojakondi/inference?scriptVersionId=53074627)",
    "1177379": "Getting a 404",
    "1177381": "Thanks for sharing, @saimanojakondi \nHowever, the link is broken",
    "1177384": "apologies,\ntry this [one](https://www.kaggle.com/saimanojakondi/inference).",
    "1177385": "apologies,\ntry this [one](https://www.kaggle.com/saimanojakondi/inference)",
    "1177433": "Did you read this post?\n\n[https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/212455](url)\n\nWill look at your model shortly but 139 seems to be a score when your model does no predicting.",
    "1177446": "I forked your model - since you have private data for the model file, it of course fails for me with this error. (YES YES - I know it should fail when I run it)\n\n`FileNotFoundError: [Errno 2] No such file or directory: '../input/effnetb4/vit_large_patch16_384_best_fold1.pth'`\n\nBut guess what value I predicted for the single test image - yep a big old 2.\n\nYour generating some type of similar error.",
    "1177469": "Thanks for sharing the thread, I had a similar doubt whether my model is predicting or not, so i ran the same inference kernel on few images of train data...model is predicting those properly.",
    "1177509": "You should be getting 0 i hope....because i tried commenting out the line which is loading the weights and tried to predict and I got 0 as my label, anyways let me check it again ;)\nBut still, it didn't understand why model is not predicting, like the code is pretty much straight forward",
    "1177560": "There probably a nice long list of things that kill the model on a submit that don’t kill it during a commit.   How long after you submit can you view the submission score?   Should be several hours.",
    "1177579": "😂that's one more tricky thing here, it took couple of mins(<60) to get the score on lb",
    "1178059": "Don't due Pytorch so not able to read the code and don't have a Pytorch model that I could use in place of your private.  \n\nI would use GPU rather than cpu - was the model trained with GPU?  Pretty sure it's an error loading the model or killing it early.",
    "1178174": "yes the model is trained on GPU...If it's due to loading it should not predict stuff while committing the kernel also, isn't it?",
    "1178365": "When I had my error that predicted 0.139 I had attempted to run a model I had not loaded - so something gets written to a submission file with the hidden test process even if no model existing  - if you trained on GPU I would submit with GPU turned on and change the right code for GPU predicting.",
    "1178932": "Just now, I tried with a tpu model and it took lot of time...finally a big notebook timed out error!!😂",
    "1179125": "Whats that saying about 1 step forward and 2 steps back ?  Good luck 👍👍👍"
  },
  "source": "meta"
}