Ashish, I do not know what is happening to you. The following code that looks like your code seems to work.
resource = ResourceObject["MNIST"];
trainingData =
RandomSample[ResourceData[resource, "TrainingData"], 100];
lenet = NetChain[{
ConvolutionLayer[20, 5], Ramp, PoolingLayer[2, 2],
ConvolutionLayer[50, 5], Ramp, PoolingLayer[2, 2],
FlattenLayer[], 500, Ramp, 10, SoftmaxLayer[]},
"Output" -> NetDecoder[{"Class", Range[0, 9]}],
"Input" -> NetEncoder[{"Image", {28, 28}, "Grayscale"}]
]
NetTrain[lenet, trainingData, All, MaxTrainingRounds -> 1,
BatchSize -> 4, Method -> {"ADAM"}]["BatchLossList"]
