[英]How does image_dataset_from_directory() order the predictions of a numerical class name?
Does image_dataset_from_directory() order the class names as specified by me ie, [0,10,5] or is it sorted alphanumerically? image_dataset_from_directory() 是否按照我指定的方式对类名进行排序,即 [0,10,5] 还是按字母数字排序?
I am asking because when I use the model to make predictions I want to be sure that the order I set is followed or not.我问是因为当我使用模型进行预测时,我想确定是否遵循了我设置的顺序。
train_dataset = image_dataset_from_directory(
directory=TRAIN_DIR,
labels="inferred",
label_mode="categorical",
class_names=["0", "10", "5"],
image_size=SIZE,
seed=SEED,
subset=None,
interpolation="bilinear",
follow_links=False,
)
If will follow the order specified in class_names
argument. If 将遵循
class_names
参数中指定的顺序。
If you don't specify anything the order will be according to alphanumeric sorting.如果您未指定任何内容,则顺序将根据字母数字排序。
The exact statement from Tensorflow Documentation for argument class_names
: Tensorflow 文档中关于参数
class_names
的确切声明:
Only valid if "labels" is "inferred".
仅当“标签”为“推断”时才有效。 This is the explict list of class names (must match names of subdirectories).
这是类名的显式列表(必须与子目录的名称匹配)。 Used to control the order of the classes (otherwise alphanumerical order is used).
用于控制类的顺序(否则使用字母数字顺序)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.