train_image_gen = image_gen.flow_from_directory('/Users/harshpanwar/Desktop/Folder/train',
target_size=image_shape[:2],
batch_size=batch_size,
class_mode='binary')
Run Code Online (Sandbox Code Playgroud)
在上面的代码片段中 class_mode='binary' 表示什么。我认为这是针对图像类别的数量。我正在使用此代码在 Keras 中训练图像识别分类器以在 2 个不同类别(如狗和猫)之间进行分类。因此,如果 class_mode='binary' 用于表示两个类别,我们如何将其设为三个或更多?
image-processing training-data neural-network keras tensorflow