oh . Thanks. I was not able to debug it where the error is.
Please check my code. 


Summary
def train(n_epochs, loaders, model, optimizer, criterion, use_cuda, save_path):
    valid_loss_min = np.Inf 
    for epoch in range(1, n_epochs+1):
        train_loss = 0.0
        valid_loss = 0.0
        model.train()
        for batch_idx, (data, target) in enumerate(loaders['train']):
            optimizer.zero_grad() 
            output = model(data.unsqueeze_(0) )
            loss = criterion(output ,target)
            loss.backward()
            optimizer.step()
            train_loss = train_loss + (1/(batch_idx+1)) + (loss.data - train_loss)
        model.eval()
        for batch_idx, (data, target) in enumerate(loaders['valid']):
            # move to GPU
            if use_cuda:
                data, target = data.cuda(), target.cuda()
            ## update the average validation loss
            output = model(data.unsqueeze_(0) )
            loss = criterion(output, target)
            valid_loss = valid_loss + (1/(batch_idx+1)) + (loss.data - valid_loss)
            
    return model