I have a question concerning the flow_from_directory method of ImageDataGenerator . My Images are in RGB form , I am using transfer learning and I want to train the model on grayscale images but pre trained model expects 3 channels . There is a method in flow_from_directory color-mode which takes grayscale or RBG . My question is that if I write grayscale here , does Keras automatically converts the RGB images to grayscale or it is something else ?
IMAGE_SIZE=[224,224] resnet = InceptionResNetV2(input_shape=IMAGE_SIZE + [3] , weights='imagenet', include_top=False)
Flow_from_dir method :
test_set = test_datagen.flow_from_directory(valid_path, target_size = (224, 224), batch_size = 32, class_mode = 'categorical',color_mode='grayscale')
If you see the document ,it sey:
color_mode: One of "grayscale", "rgb", "rgba". Default: "rgb". Whether the images will be converted to have 1, 3, or 4 channels.
So, yes it turns out to be a gray scale.
1.4m articles
1.4m replys
5 comments
57.0k users