{
  "id": 265234,
  "title": "EfficientNet3D Training: val_score=0.5",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/265234",
  "author_name": "cool_rabbit",
  "post_date": "2021-08-15T06:20:32.891000",
  "votes": 10,
  "comment_count": 19,
  "views": 0,
  "content": "<p>When I train 3D-efnetb0 using all images, all oofs are the same and val_auc is 0.500000.</p>\n<p>Does anyone have the same situation?</p>",
  "messages": [
    {
      "id": 1472814,
      "postDate": "2021-08-15T06:20:32.890Z",
      "content": "<p>When I train 3D-efnetb0 using all images, all oofs are the same and val_auc is 0.500000.</p>\n<p>Does anyone have the same situation?</p>",
      "rawMarkdown": "When I train 3D-efnetb0 using all images, all oofs are the same and val_auc is 0.500000.\n\nDoes anyone have the same situation?",
      "votes": 9
    },
    {
      "id": 1476350,
      "postDate": "2021-08-17T05:15:17.560Z",
      "content": "<p>Me too!  I have the same output of oofs.<br>\nI find the same issues on GitHub.<br>\n<a href=\"https://github.com/shijianjian/EfficientNet-PyTorch-3D/issues/6\" target=\"_blank\">Same outputs after model.eval() </a></p>\n<p>So, I use model.train and with no grad instead of model.eval .<br>\nThen I solve this problem.<br>\nBut I don't know this is a good solution.</p>",
      "rawMarkdown": "Me too!  I have the same output of oofs.\nI find the same issues on GitHub.\n[Same outputs after model.eval() ](https://github.com/shijianjian/EfficientNet-PyTorch-3D/issues/6)\n\nSo, I use model.train and with no grad instead of model.eval .\nThen I solve this problem.\nBut I don't know this is a good solution.\n",
      "votes": 1,
      "replies": [
        {
          "id": 1476428,
          "postDate": "2021-08-17T05:47:32.990Z",
          "content": "<p>Thanks for the info!<br>\nYour method also worked in my env (not 0.5). <br>\nSo maybe some error in the original code (dropout / batch norm).</p>",
          "rawMarkdown": "Thanks for the info!\nYour method also worked in my env (not 0.5). \nSo maybe some error in the original code (dropout / batch norm).",
          "votes": 1
        },
        {
          "id": 1476578,
          "postDate": "2021-08-17T07:07:11.940Z",
          "content": "<p>Train and no grad is the recommended approach when using pytorch. Also for future models a good indication to check if your model is working is to train a small dataset (say 10) and check if your model overfits.</p>",
          "rawMarkdown": "Train and no grad is the recommended approach when using pytorch. Also for future models a good indication to check if your model is working is to train a small dataset (say 10) and check if your model overfits."
        },
        {
          "id": 1482911,
          "postDate": "2021-08-20T10:49:37.760Z",
          "rawMarkdown": "",
          "isDeleted": true,
          "replies": [
            {
              "id": 1484215,
              "postDate": "2021-08-21T06:13:03.113Z",
              "content": "<blockquote>\n  <p>But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?</p>\n  <p>But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?</p>\n</blockquote>\n<p>Yes.<br>\nI use model.train insted of model.eval when validation and prediction step</p>",
              "rawMarkdown": "> But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?\n\n> But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?\n\nYes.\nI use model.train insted of model.eval when validation and prediction step"
            }
          ]
        },
        {
          "id": 1489452,
          "postDate": "2021-08-25T02:32:34.307Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1489518,
          "postDate": "2021-08-25T04:16:34.757Z",
          "content": "<p>Dropout randomly drops out layers with whatever probability you give it. When predicting dropout is turned off.<br>\nIts turned off when you do model.eval</p>",
          "rawMarkdown": "Dropout randomly drops out layers with whatever probability you give it. When predicting dropout is turned off.\nIts turned off when you do model.eval"
        },
        {
          "id": 1489556,
          "postDate": "2021-08-25T05:06:08.600Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1489776,
          "postDate": "2021-08-25T09:00:51.070Z",
          "content": "<p><a href=\"https://www.kaggle.com/lai321\" target=\"_blank\">@lai321</a> <br>\nSorry, I hadn't concern about that. <br>\nDropout and Batch norm  layers are different behavior when train mode or validation mode.<br>\nSo this solution has not good.<br>\nBut I haven't any other idea.<br>\nthanks for your comment.</p>",
          "rawMarkdown": "@lai321 \nSorry, I hadn't concern about that. \nDropout and Batch norm  layers are different behavior when train mode or validation mode.\nSo this solution has not good.\nBut I haven't any other idea.\nthanks for your comment."
        }
      ]
    },
    {
      "id": 1476040,
      "postDate": "2021-08-17T00:44:11.200Z",
      "content": "<p>From what i have read about AUC an auc of 0.50 roughly indicates that your model is making random predictions i.e. it is what you would expect if you evaluate properties randomly</p>",
      "rawMarkdown": "From what i have read about AUC an auc of 0.50 roughly indicates that your model is making random predictions i.e. it is what you would expect if you evaluate properties randomly",
      "votes": 1,
      "replies": [
        {
          "id": 1476208,
          "postDate": "2021-08-17T03:20:38.267Z",
          "content": "<p>That's right, something is strange.<br>\n2D-efnet works well although it is still tough for a model to be trained.</p>",
          "rawMarkdown": "That's right, something is strange.\n2D-efnet works well although it is still tough for a model to be trained."
        }
      ]
    },
    {
      "id": 1473109,
      "postDate": "2021-08-15T11:04:29.907Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true,
      "replies": [
        {
          "id": 1473119,
          "postDate": "2021-08-15T11:14:33.560Z",
          "content": "<p>What I did is training with this amazing dataset (4x128x128x128).<br>\n<a href=\"https://www.kaggle.com/ren4yu/normalized-voxels-align-planes-and-crop\" target=\"_blank\">https://www.kaggle.com/ren4yu/normalized-voxels-align-planes-and-crop</a><br>\nSurely the data itself, dataset and dataloader work well.<br>\nAs you indicate, we need pretrained weight like imagenet for better score.<br>\nI don't know why public notebooks have some val_score &gt; 0.5.</p>",
          "rawMarkdown": "What I did is training with this amazing dataset (4x128x128x128).\nhttps://www.kaggle.com/ren4yu/normalized-voxels-align-planes-and-crop\nSurely the data itself, dataset and dataloader work well.\nAs you indicate, we need pretrained weight like imagenet for better score.\nI don't know why public notebooks have some val_score > 0.5."
        },
        {
          "id": 1473127,
          "postDate": "2021-08-15T11:25:09.930Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1473129,
          "postDate": "2021-08-15T11:30:13.907Z",
          "content": "<p>I see.<br>\nBTW, there is memory_efficient_swish at the last layer.<br>\nDid you change it to something or use as it is?</p>",
          "rawMarkdown": "I see.\nBTW, there is memory_efficient_swish at the last layer.\nDid you change it to something or use as it is?"
        },
        {
          "id": 1473143,
          "postDate": "2021-08-15T11:45:57.203Z",
          "rawMarkdown": "",
          "votes": 1,
          "isDeleted": true
        },
        {
          "id": 1473196,
          "postDate": "2021-08-15T12:25:31.350Z",
          "content": "<p>Would pretrained weights really help a lot? See this discussion: <a href=\"https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262103#1453708\" target=\"_blank\">https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262103#1453708</a>. It seems like the score of the best public notebook is almost as good as random. How was your loss while training?</p>",
          "rawMarkdown": "Would pretrained weights really help a lot? See this discussion: https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262103#1453708. It seems like the score of the best public notebook is almost as good as random. How was your loss while training?"
        },
        {
          "id": 1473324,
          "postDate": "2021-08-15T14:06:27.410Z",
          "rawMarkdown": "",
          "votes": 1,
          "isDeleted": true
        },
        {
          "id": 1476000,
          "postDate": "2021-08-16T23:54:44.657Z",
          "content": "<p>The last layer is not a swish activation. It's a linear layer (model._fc) outing logits. I know it may look like that in a summary, but the summary is wrong.</p>",
          "rawMarkdown": "The last layer is not a swish activation. It's a linear layer (model._fc) outing logits. I know it may look like that in a summary, but the summary is wrong."
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1476350,
      "author_name": "kazu02",
      "author_url": "",
      "post_date": "2021-08-17T05:15:17.560000",
      "content": "<p>Me too!  I have the same output of oofs.<br>\nI find the same issues on GitHub.<br>\n<a href=\"https://github.com/shijianjian/EfficientNet-PyTorch-3D/issues/6\" target=\"_blank\">Same outputs after model.eval() </a></p>\n<p>So, I use model.train and with no grad instead of model.eval .<br>\nThen I solve this problem.<br>\nBut I don't know this is a good solution.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1476428,
          "author_name": "cool_rabbit",
          "author_url": "",
          "post_date": "2021-08-17T05:47:32.990000",
          "content": "<p>Thanks for the info!<br>\nYour method also worked in my env (not 0.5). <br>\nSo maybe some error in the original code (dropout / batch norm).</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1476578,
          "author_name": "Aryaman Sharma",
          "author_url": "",
          "post_date": "2021-08-17T07:07:11.940000",
          "content": "<p>Train and no grad is the recommended approach when using pytorch. Also for future models a good indication to check if your model is working is to train a small dataset (say 10) and check if your model overfits.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1482911,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-20T10:49:37.760000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 1484215,
              "author_name": "kazu02",
              "author_url": "",
              "post_date": "2021-08-21T06:13:03.113000",
              "content": "<blockquote>\n  <p>But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?</p>\n  <p>But we usually pick model in valid_epoch, where model is model.eval(), so do you set model.train() in validation epoch for your method?</p>\n</blockquote>\n<p>Yes.<br>\nI use model.train insted of model.eval when validation and prediction step</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 1489452,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-25T02:32:34.307000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1489518,
          "author_name": "Aryaman Sharma",
          "author_url": "",
          "post_date": "2021-08-25T04:16:34.757000",
          "content": "<p>Dropout randomly drops out layers with whatever probability you give it. When predicting dropout is turned off.<br>\nIts turned off when you do model.eval</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1489556,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-25T05:06:08.600000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1489776,
          "author_name": "kazu02",
          "author_url": "",
          "post_date": "2021-08-25T09:00:51.070000",
          "content": "<p><a href=\"https://www.kaggle.com/lai321\" target=\"_blank\">@lai321</a> <br>\nSorry, I hadn't concern about that. <br>\nDropout and Batch norm  layers are different behavior when train mode or validation mode.<br>\nSo this solution has not good.<br>\nBut I haven't any other idea.<br>\nthanks for your comment.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1476040,
      "author_name": "Aryaman Sharma",
      "author_url": "",
      "post_date": "2021-08-17T00:44:11.200000",
      "content": "<p>From what i have read about AUC an auc of 0.50 roughly indicates that your model is making random predictions i.e. it is what you would expect if you evaluate properties randomly</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1476208,
          "author_name": "cool_rabbit",
          "author_url": "",
          "post_date": "2021-08-17T03:20:38.267000",
          "content": "<p>That's right, something is strange.<br>\n2D-efnet works well although it is still tough for a model to be trained.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1473109,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-08-15T11:04:29.907000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 1473119,
          "author_name": "cool_rabbit",
          "author_url": "",
          "post_date": "2021-08-15T11:14:33.560000",
          "content": "<p>What I did is training with this amazing dataset (4x128x128x128).<br>\n<a href=\"https://www.kaggle.com/ren4yu/normalized-voxels-align-planes-and-crop\" target=\"_blank\">https://www.kaggle.com/ren4yu/normalized-voxels-align-planes-and-crop</a><br>\nSurely the data itself, dataset and dataloader work well.<br>\nAs you indicate, we need pretrained weight like imagenet for better score.<br>\nI don't know why public notebooks have some val_score &gt; 0.5.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1473127,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-15T11:25:09.930000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1473129,
          "author_name": "cool_rabbit",
          "author_url": "",
          "post_date": "2021-08-15T11:30:13.907000",
          "content": "<p>I see.<br>\nBTW, there is memory_efficient_swish at the last layer.<br>\nDid you change it to something or use as it is?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1473143,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-15T11:45:57.203000",
          "content": "",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1473196,
          "author_name": "novice03",
          "author_url": "",
          "post_date": "2021-08-15T12:25:31.350000",
          "content": "<p>Would pretrained weights really help a lot? See this discussion: <a href=\"https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262103#1453708\" target=\"_blank\">https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262103#1453708</a>. It seems like the score of the best public notebook is almost as good as random. How was your loss while training?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1473324,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-08-15T14:06:27.410000",
          "content": "",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1476000,
          "author_name": "Pandagg",
          "author_url": "",
          "post_date": "2021-08-16T23:54:44.657000",
          "content": "<p>The last layer is not a swish activation. It's a linear layer (model._fc) outing logits. I know it may look like that in a summary, but the summary is wrong.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1472814": "When I train 3D-efnetb0 using all images, all oofs are the same and val_auc is 0.500000.\n\nDoes anyone have the same situation?",
    "1476350": "Me too!  I have the same output of oofs.\nI find the same issues on GitHub.\n[Same outputs after model.eval() ](https://github.com/shijianjian/EfficientNet-PyTorch-3D/issues/6)\n\nSo, I use model.train and with no grad instead of model.eval .\nThen I solve this problem.\nBut I don't know this is a good solution.\n",
    "1476040": "From what i have read about AUC an auc of 0.50 roughly indicates that your model is making random predictions i.e. it is what you would expect if you evaluate properties randomly",
    "1473109": ""
  }
}