{
  "id": 114312,
  "title": "How to normalize?",
  "url": "/competitions/understanding_cloud_organization/discussion/114312",
  "author_name": "",
  "post_date": "2019-10-25T12:21:21.393749100Z",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>The loss of validation is strange.</p>\n\n<p>I use\n- U-Net(efficientnet-b3, imagenet(weight))\n- <a href=\"https://www.kaggle.com/artgor/segmentation-in-pytorch-using-convenient-tools#Model-training\">This kernel</a> almost the same</p>\n\n<p>The validation loss is unusually high.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fa68774c1d4ac186c62deb87253620843%2FScreenshot%20from%202019-10-25%2021-11-47.png?generation=1572005834655874&amp;alt=media\" alt=\"log\"></p>\n\n<p>What are the possible reasons?</p>\n\n<p>Maybe, because there was a bug in the normalization code.</p>\n\n<p>NOW\n<code>python\ntrain_transform = [\n    albu.HorizontalFlip(p=0.5),\n    albu.ShiftScaleRotate(scale_limit=0.5, rotate_limit=0, shift_limit=0.1, p=0.5, border_mode=0),\n    albu.GridDistortion(p=0.5),\n    albu.OpticalDistortion(p=0.5, distort_limit=2, shift_limit=0.5),\n    # albu.Normalize(mean=0.45, std=0.23),\n    albu.Resize(320, 640)\n]\n</code>\nHow to normalize?</p>\n\n<p>I'm sorry for the poor English.</p>",
  "messages": [
    {
      "id": "657783",
      "postDate": "10/25/2019 12:21:21",
      "content": "<p>The loss of validation is strange.</p>\n\n<p>I use\n- U-Net(efficientnet-b3, imagenet(weight))\n- <a href=\"https://www.kaggle.com/artgor/segmentation-in-pytorch-using-convenient-tools#Model-training\">This kernel</a> almost the same</p>\n\n<p>The validation loss is unusually high.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fa68774c1d4ac186c62deb87253620843%2FScreenshot%20from%202019-10-25%2021-11-47.png?generation=1572005834655874&amp;alt=media\" alt=\"log\"></p>\n\n<p>What are the possible reasons?</p>\n\n<p>Maybe, because there was a bug in the normalization code.</p>\n\n<p>NOW\n<code>python\ntrain_transform = [\n    albu.HorizontalFlip(p=0.5),\n    albu.ShiftScaleRotate(scale_limit=0.5, rotate_limit=0, shift_limit=0.1, p=0.5, border_mode=0),\n    albu.GridDistortion(p=0.5),\n    albu.OpticalDistortion(p=0.5, distort_limit=2, shift_limit=0.5),\n    # albu.Normalize(mean=0.45, std=0.23),\n    albu.Resize(320, 640)\n]\n</code>\nHow to normalize?</p>\n\n<p>I'm sorry for the poor English.</p>",
      "rawMarkdown": "The loss of validation is strange.\n\nI use\n- U-Net(efficientnet-b3, imagenet(weight))\n- [This kernel](https://www.kaggle.com/artgor/segmentation-in-pytorch-using-convenient-tools#Model-training) almost the same\n\nThe validation loss is unusually high.\n\n![log](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fa68774c1d4ac186c62deb87253620843%2FScreenshot%20from%202019-10-25%2021-11-47.png?generation=1572005834655874&amp;alt=media)\n\n\n\nWhat are the possible reasons?\n\nMaybe, because there was a bug in the normalization code.\n\nNOW\n```python\ntrain_transform = [\n    albu.HorizontalFlip(p=0.5),\n    albu.ShiftScaleRotate(scale_limit=0.5, rotate_limit=0, shift_limit=0.1, p=0.5, border_mode=0),\n    albu.GridDistortion(p=0.5),\n    albu.OpticalDistortion(p=0.5, distort_limit=2, shift_limit=0.5),\n    # albu.Normalize(mean=0.45, std=0.23),\n    albu.Resize(320, 640)\n]\n```\nHow to normalize?\n\nI'm sorry for the poor English.",
      "votes": null
    },
    {
      "id": "658497",
      "postDate": "10/26/2019 04:21:10",
      "content": "<p>How many channels of images do you use ?\nI'm not sure, but you should probably remove the parameters or use famous parameters.\nFor example, albu.Normalize(mean=0.45, std=0.23)→albu.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))</p>\n\n<p><a href=\"https://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2\">https://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2</a></p>",
      "rawMarkdown": "How many channels of images do you use ?\nI'm not sure, but you should probably remove the parameters or use famous parameters.\nFor example, albu.Normalize(mean=0.45, std=0.23)→albu.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))\n\nhttps://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2",
      "votes": null
    },
    {
      "id": "658514",
      "postDate": "10/26/2019 05:04:56",
      "content": "<p>Thank you.\nAfter posting this discussion, I guessed it that way too, but it didn't work.</p>\n\n<p>After reviewing the code, I found that I did not normalize the validation data.</p>\n\n<p>This is just my mistake.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fcecb435903c22098728a64ccd18fb5f1%2FScreenshot%20from%202019-10-26%2013-59-23.png?generation=1572065983086950&amp;alt=media\" alt=\"code\"></p>\n\n<p>It has been improved.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2F9c50ab7fbda98d94b71de5ae7ed8ada7%2FScreenshot%20from%202019-10-26%2014-02-57.png?generation=1572066194381644&amp;alt=media\" alt=\"log\"></p>",
      "rawMarkdown": "Thank you.\nAfter posting this discussion, I guessed it that way too, but it didn't work.\n\nAfter reviewing the code, I found that I did not normalize the validation data.\n\nThis is just my mistake.\n\n\n![code](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fcecb435903c22098728a64ccd18fb5f1%2FScreenshot%20from%202019-10-26%2013-59-23.png?generation=1572065983086950&amp;alt=media)\n\nIt has been improved.\n\n![log](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2F9c50ab7fbda98d94b71de5ae7ed8ada7%2FScreenshot%20from%202019-10-26%2014-02-57.png?generation=1572066194381644&amp;alt=media)",
      "votes": null
    },
    {
      "id": "658520",
      "postDate": "10/26/2019 05:30:09",
      "content": "<p>Glad to hear so.\nTo Japanese young treasure, Good luck !!</p>",
      "rawMarkdown": "Glad to hear so.\nTo Japanese young treasure, Good luck !!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 658497,
      "author_name": "yasagure",
      "author_url": "",
      "post_date": "10/26/2019 04:21:10",
      "content": "<p>How many channels of images do you use ?\nI'm not sure, but you should probably remove the parameters or use famous parameters.\nFor example, albu.Normalize(mean=0.45, std=0.23)→albu.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))</p>\n\n<p><a href=\"https://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2\">https://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 658514,
          "author_name": "chizuchizu",
          "author_url": "",
          "post_date": "10/26/2019 05:04:56",
          "content": "<p>Thank you.\nAfter posting this discussion, I guessed it that way too, but it didn't work.</p>\n\n<p>After reviewing the code, I found that I did not normalize the validation data.</p>\n\n<p>This is just my mistake.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fcecb435903c22098728a64ccd18fb5f1%2FScreenshot%20from%202019-10-26%2013-59-23.png?generation=1572065983086950&amp;alt=media\" alt=\"code\"></p>\n\n<p>It has been improved.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2F9c50ab7fbda98d94b71de5ae7ed8ada7%2FScreenshot%20from%202019-10-26%2014-02-57.png?generation=1572066194381644&amp;alt=media\" alt=\"log\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 658520,
          "author_name": "yasagure",
          "author_url": "",
          "post_date": "10/26/2019 05:30:09",
          "content": "<p>Glad to hear so.\nTo Japanese young treasure, Good luck !!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "657783": "The loss of validation is strange.\n\nI use\n- U-Net(efficientnet-b3, imagenet(weight))\n- [This kernel](https://www.kaggle.com/artgor/segmentation-in-pytorch-using-convenient-tools#Model-training) almost the same\n\nThe validation loss is unusually high.\n\n![log](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fa68774c1d4ac186c62deb87253620843%2FScreenshot%20from%202019-10-25%2021-11-47.png?generation=1572005834655874&amp;alt=media)\n\n\n\nWhat are the possible reasons?\n\nMaybe, because there was a bug in the normalization code.\n\nNOW\n```python\ntrain_transform = [\n    albu.HorizontalFlip(p=0.5),\n    albu.ShiftScaleRotate(scale_limit=0.5, rotate_limit=0, shift_limit=0.1, p=0.5, border_mode=0),\n    albu.GridDistortion(p=0.5),\n    albu.OpticalDistortion(p=0.5, distort_limit=2, shift_limit=0.5),\n    # albu.Normalize(mean=0.45, std=0.23),\n    albu.Resize(320, 640)\n]\n```\nHow to normalize?\n\nI'm sorry for the poor English.",
    "658497": "How many channels of images do you use ?\nI'm not sure, but you should probably remove the parameters or use famous parameters.\nFor example, albu.Normalize(mean=0.45, std=0.23)→albu.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))\n\nhttps://stackoverflow.com/questions/58151507/why-pytorch-officially-use-mean-0-485-0-456-0-406-and-std-0-229-0-224-0-2",
    "658514": "Thank you.\nAfter posting this discussion, I guessed it that way too, but it didn't work.\n\nAfter reviewing the code, I found that I did not normalize the validation data.\n\nThis is just my mistake.\n\n\n![code](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2Fcecb435903c22098728a64ccd18fb5f1%2FScreenshot%20from%202019-10-26%2013-59-23.png?generation=1572065983086950&amp;alt=media)\n\nIt has been improved.\n\n![log](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2523201%2F9c50ab7fbda98d94b71de5ae7ed8ada7%2FScreenshot%20from%202019-10-26%2014-02-57.png?generation=1572066194381644&amp;alt=media)",
    "658520": "Glad to hear so.\nTo Japanese young treasure, Good luck !!"
  },
  "source": "meta"
}