Given groups=1, weight[16, 1, 5, 5], so expected input[100, 3, 64, 64] to have 1 channels, but got 3 channels instead

Actually while converting jpg format to gray scale we have to use img.convert(‘LA’) instead of img.convert(‘L’).
I read that while reading gray scale image in opencv it gives us 3 layers of gray scale. I tried PNG format still its showing the same error.