【问题标题】:having problem with tfds.load() oxford data in jupyter notebookjupyter notebook 中的 tfds.load() 牛津数据有问题
【发布时间】:2021-06-13 14:29:20
【问题描述】:

数据集,info = tfds.load('oxford_iiit_pet:3..', with_info=True)

ValueError: 没有足够的值来解包(预期 3,得到 1)

【问题讨论】:

标签: tensorflow jupyter-notebook image-segmentation


【解决方案1】:

请检查数据集的名称。正确的数据集名称是oxford_iiit_pet

您可以按照以下代码导入数据集:

!pip install tensorflow_datasets

import tensorflow as tf
import tensorflow_dataset as tfds

dataset = tfds.load('oxford_iiit_pet', split='train', shuffle_files=True)

(train_ds, val_ds, test_ds), metadata = tfds.load(
    'oxford_iiit_pet',
    split=['train[:80%]', 'train[80%:90%]', 'train[90%:]'],
    with_info=True,
    as_supervised=True,
)

OR 用于数据集可视化(tfds.as_dataframe)

ds, info = tfds.load('oxford_iiit_pet', split='train', with_info=True)

tfds.as_dataframe(ds.take(4), info)

有几种不同的方式来加载内置数据集。请找到参考here.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-22
    • 2019-05-29
    • 2019-05-23
    • 1970-01-01
    • 2014-02-27
    • 2021-11-16
    • 2019-04-19
    • 1970-01-01
    相关资源
    最近更新 更多