I followed the example ImageNet to complete a project for semantic segmentation task.
the code structure as follows:
def main()
... 
    for epoch in range(start_epoch, epochs+1):
        _train_epoch(epoch)
        _valid_epoch(epoch)
        ... ...
def _train_epoch(epcoh):
    ... ... 
    model.train()
    for steps, (data, target) in enumerate(train_data_loader):
         ... ...
         loss and metrics
def _valid_epoch(epoch):
    ... ...
    model.eval()
    with torch.no_grad():
        for steps,(data, target) in enumerate(valid_data_loader):
            ... ...
            loss and metrics

The problem use model.eval() the metrics are almost zero and loss is very high. But when I remove model.eval() the metrics and loss seems normal.  And in my network there exists BatchNorm and Dropout layers so I think the model.eval() is necessary. So what can be the problem is?
Thanks in advance.