I’ve used PIL and it’s working using the L format:
img=Image.open('PATH')
img=img.convert('L')
img.save('tmp.png')
gray = Image.open('tmp.png')

gray won’t have a color channel after loading, so you might need to unsqueeze(0) the tensor.