【问题标题】:How to create a custom image dataset in Tensorflow如何在 Tensorflow 中创建自定义图像数据集
【发布时间】:2019-09-03 22:13:29
【问题描述】:

我正在尝试使用 Estimators 和/或 Keras 创建图像分类器。

我一直在关注这个页面上的教程:https://www.tensorflow.org/tutorials/load_data/images

我已经使用此代码构建了一个图像和标签数据集:

ds = tf.data.Dataset.from_tensor_slices((all_image_paths, all_image_labels))

image_label_ds = ds.map(load_and_preprocess_from_path_label)

image_label_ds 输出如下:

<DatasetV1Adapter shapes: ((180, 360, 3), ()), types: (tf.float32, tf.int32)>

由于本教程使用的 MobileNetV2 接受大小为 (192,192,3) 的图像,因此我无法再遵循本教程。

有人可以向我解释如何对数据集执行所有必要的准备并将其输入 DNNClassifier Premade Estimator 吗?

【问题讨论】:

标签: python tensorflow keras


【解决方案1】:

问题不清楚,为什么不能继续学习呢?

无论如何,如果问题是不同的输入大小,那么在教程中您定义网络的输入形状:

mobile_net = tf.keras.applications.MobileNetV2(input_shape=(192, 192, 3), include_top=False)

尝试将网络的 input_shape 定义为您使用的图像尺寸 - (180, 360, 3)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-11
    • 2020-05-12
    • 1970-01-01
    • 2022-11-05
    • 1970-01-01
    • 2019-06-19
    • 2022-01-25
    相关资源
    最近更新 更多