You can define the number of channels inside decoding function like tf.image.decode_image(image, channels=3) and use it when you are creating a dataset. It will convert 4-channel images into 3-channel tensors.