Thanks for your response.
Actually i am getting my ground truth image with three channels when i read it and make tensors for further processing. When i convert my ground truth to gray scale it shows zero. In reality it should have three classes in it. but reading the three channels will show me accurately three classes.
Note: I am facing it on ground truth images. Else the code works well. Also if there is a model which accept 3 channel ground truth image then suggest me please.