{
  "id": 349790,
  "title": "Same Setup but Different Results",
  "url": "/competitions/hubmap-organ-segmentation/discussion/349790",
  "author_name": "",
  "post_date": "2022-09-02T18:03:33.534475800Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5225675%2Fcc4115aeb98965f26a8273ba3821a59f%2FScreen%20Shot%202022-09-02%20at%202.00.49%20PM.png?generation=1662141662504707&amp;alt=media\" alt=\"\"></p>\n<p>I'm training a single-fold U-Net EfficientNetB7 backbone baseline with naive image rescaling to (340, 340)</p>\n<p>Those two setups are completely the same, but they have drastically different results. I made sure to run seed_everything before the model is trained. I have data augmentation, but I think that should not cause such a difference. Any ideas why those two completely same setups can have such different results?</p>\n<p>A million thanks!!</p>",
  "messages": [
    {
      "id": "1924104",
      "postDate": "09/02/2022 18:03:33",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5225675%2Fcc4115aeb98965f26a8273ba3821a59f%2FScreen%20Shot%202022-09-02%20at%202.00.49%20PM.png?generation=1662141662504707&amp;alt=media\" alt=\"\"></p>\n<p>I'm training a single-fold U-Net EfficientNetB7 backbone baseline with naive image rescaling to (340, 340)</p>\n<p>Those two setups are completely the same, but they have drastically different results. I made sure to run seed_everything before the model is trained. I have data augmentation, but I think that should not cause such a difference. Any ideas why those two completely same setups can have such different results?</p>\n<p>A million thanks!!</p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5225675%2Fcc4115aeb98965f26a8273ba3821a59f%2FScreen%20Shot%202022-09-02%20at%202.00.49%20PM.png?generation=1662141662504707&alt=media)\n\nI'm training a single-fold U-Net EfficientNetB7 backbone baseline with naive image rescaling to (340, 340)\n\nThose two setups are completely the same, but they have drastically different results. I made sure to run seed_everything before the model is trained. I have data augmentation, but I think that should not cause such a difference. Any ideas why those two completely same setups can have such different results?\n\nA million thanks!!",
      "votes": null
    },
    {
      "id": "1924133",
      "postDate": "09/02/2022 18:40:54",
      "content": "<p>Just curious: Why is your <code>val_dice</code> is not in [0; 1] ? </p>",
      "rawMarkdown": "Just curious: Why is your `val_dice` is not in [0; 1] ?",
      "votes": null
    },
    {
      "id": "1924146",
      "postDate": "09/02/2022 18:55:26",
      "content": "<p>I'm sorry I should've noted that: I didn't divide by the number of batches in my val set. Here there are 18 batches so the final val_dice should be the one shown divided by 18. Thank you for asking!</p>",
      "rawMarkdown": "I'm sorry I should've noted that: I didn't divide by the number of batches in my val set. Here there are 18 batches so the final val_dice should be the one shown divided by 18. Thank you for asking!",
      "votes": null
    },
    {
      "id": "1924352",
      "postDate": "09/03/2022 02:02:44",
      "content": "<p>algorithm debugging is a painful process</p>\n<ul>\n<li>compare the initialization of the network parameters (especially those newly added layers that are not loaded with pretrain weights)</li>\n<li>check input are the same in different experiment</li>\n<li>check output: save some values during training. e.g. per layer feature map (data, grad) of a batch …</li>\n<li>compare the values and you will know what's go wrong.</li>\n</ul>\n<p>in summary:<br>\ncheck initialization before train, input and output at training</p>\n<hr>\n<p>but maybe it is not important if the results is \"about the same\".</p>\n<hr>\n<p>\"I have data augmentation, but I think that should not cause such a difference.\"<br>\nyes it may</p>",
      "rawMarkdown": "algorithm debugging is a painful process\n- compare the initialization of the network parameters (especially those newly added layers that are not loaded with pretrain weights)\n- check input are the same in different experiment\n- check output: save some values during training. e.g. per layer feature map (data, grad) of a batch ...\n- compare the values and you will know what's go wrong.\n\nin summary:\ncheck initialization before train, input and output at training\n\n---\n\nbut maybe it is not important if the results is \"about the same\".\n\n---\n\n\"I have data augmentation, but I think that should not cause such a difference.\"\nyes it may",
      "votes": null
    },
    {
      "id": "1924423",
      "postDate": "09/03/2022 03:31:36",
      "content": "<p>Thank you so much!! It is indeed quite a challenge. Your suggestions really really helped me to learn a lot, and I will definitely try to do these as much as possible!</p>\n<p>Now I highly doubt I still didn't do the \"seed everything\" operation correctly, and the UNet I'm using is also possible that the decoder part is not pretrained and the last layer is not also pretrained. I'll also check those!</p>",
      "rawMarkdown": "Thank you so much!! It is indeed quite a challenge. Your suggestions really really helped me to learn a lot, and I will definitely try to do these as much as possible!\n\nNow I highly doubt I still didn't do the \"seed everything\" operation correctly, and the UNet I'm using is also possible that the decoder part is not pretrained and the last layer is not also pretrained. I'll also check those!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1924133,
      "author_name": "vladimirsydor",
      "author_url": "",
      "post_date": "09/02/2022 18:40:54",
      "content": "<p>Just curious: Why is your <code>val_dice</code> is not in [0; 1] ? </p>",
      "votes": null,
      "replies": [
        {
          "id": 1924146,
          "author_name": "zhongxuanwang",
          "author_url": "",
          "post_date": "09/02/2022 18:55:26",
          "content": "<p>I'm sorry I should've noted that: I didn't divide by the number of batches in my val set. Here there are 18 batches so the final val_dice should be the one shown divided by 18. Thank you for asking!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1924352,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "09/03/2022 02:02:44",
      "content": "<p>algorithm debugging is a painful process</p>\n<ul>\n<li>compare the initialization of the network parameters (especially those newly added layers that are not loaded with pretrain weights)</li>\n<li>check input are the same in different experiment</li>\n<li>check output: save some values during training. e.g. per layer feature map (data, grad) of a batch …</li>\n<li>compare the values and you will know what's go wrong.</li>\n</ul>\n<p>in summary:<br>\ncheck initialization before train, input and output at training</p>\n<hr>\n<p>but maybe it is not important if the results is \"about the same\".</p>\n<hr>\n<p>\"I have data augmentation, but I think that should not cause such a difference.\"<br>\nyes it may</p>",
      "votes": null,
      "replies": [
        {
          "id": 1924423,
          "author_name": "zhongxuanwang",
          "author_url": "",
          "post_date": "09/03/2022 03:31:36",
          "content": "<p>Thank you so much!! It is indeed quite a challenge. Your suggestions really really helped me to learn a lot, and I will definitely try to do these as much as possible!</p>\n<p>Now I highly doubt I still didn't do the \"seed everything\" operation correctly, and the UNet I'm using is also possible that the decoder part is not pretrained and the last layer is not also pretrained. I'll also check those!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1924104": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5225675%2Fcc4115aeb98965f26a8273ba3821a59f%2FScreen%20Shot%202022-09-02%20at%202.00.49%20PM.png?generation=1662141662504707&alt=media)\n\nI'm training a single-fold U-Net EfficientNetB7 backbone baseline with naive image rescaling to (340, 340)\n\nThose two setups are completely the same, but they have drastically different results. I made sure to run seed_everything before the model is trained. I have data augmentation, but I think that should not cause such a difference. Any ideas why those two completely same setups can have such different results?\n\nA million thanks!!",
    "1924133": "Just curious: Why is your `val_dice` is not in [0; 1] ?",
    "1924146": "I'm sorry I should've noted that: I didn't divide by the number of batches in my val set. Here there are 18 batches so the final val_dice should be the one shown divided by 18. Thank you for asking!",
    "1924352": "algorithm debugging is a painful process\n- compare the initialization of the network parameters (especially those newly added layers that are not loaded with pretrain weights)\n- check input are the same in different experiment\n- check output: save some values during training. e.g. per layer feature map (data, grad) of a batch ...\n- compare the values and you will know what's go wrong.\n\nin summary:\ncheck initialization before train, input and output at training\n\n---\n\nbut maybe it is not important if the results is \"about the same\".\n\n---\n\n\"I have data augmentation, but I think that should not cause such a difference.\"\nyes it may",
    "1924423": "Thank you so much!! It is indeed quite a challenge. Your suggestions really really helped me to learn a lot, and I will definitely try to do these as much as possible!\n\nNow I highly doubt I still didn't do the \"seed everything\" operation correctly, and the UNet I'm using is also possible that the decoder part is not pretrained and the last layer is not also pretrained. I'll also check those!"
  },
  "source": "meta"
}