Consider the following network snippet
def __init__(self):
  ...
  self.fc_hidden_0 = nn.Linear(586, 100)
  self.bn_hidden_0 = nn.BatchNorm1d(100)

def forward(self, X):
  ...
  out = F.leaky_relu(self.bn_hidden_0(self.fc_hidden_0(out)))

Batch size is 32 (tried 20 as well) and sometime the the error is thrown -
ValueError: Expected more than 1 value per channel when training, got input size [1, 100]

I was trying to understand #ptrblck response that BatcNorm could be the problem which expects 100 values but does it expect that value of batch size  32 x 100 and getting a single instance as may be the train-loader is getting the last data segment?
Note that when I restart the training (followed by validation and train again) then the error is gone. Also note that model train() and eval() is placed before the starting of training and validation.