首页 > 解决方案 > ImageDatagenerator 将灰度图像转换为 rgb 的过程

问题描述

我想在预训练的 vgg16 模型上训练我的灰度图像。我正在使用带有 color_mode = 'rgb' 的 imagedatagenerator。它将灰度图像转换为 rgb,但我不知道那里使用的过程是否会导致某种信息丢失。有人可以帮助我了解转换的方法是什么。

train_generator = datagen.flow_from_directory(train_path,
                                          target_size=(48,48),
                                          color_mode='rgb',
                                          batch_size=64,
                                          class_mode='categorical',
                                          shuffle=True)

标签: image-processingkerasdeep-learningconv-neural-network

解决方案


推荐阅读