tensorflow / tensorflow/datasets

Loading the iris dataset via tfds.load does not return a tf.data.Dataset object

Open
#3,821 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.6k
Forks
1.6k
Avg merge
3h 54m
Merged PRs (30d)
1

Description

Short description
When I load the iris dataset (https://www.tensorflow.org/datasets/catalog/iris) using the tfds.load function, the returned object is not a tf.data.Dataset object (which should be the case according to https://www.tensorflow.org/datasets/overview#tfdsload).

Environment information

  • Operating System: macOS

  • Python version: 3.8

  • tensorflow-datasets/tfds-nightly version: tensorflow-datasets 4.5.2

  • tensorflow/tf-nightly version: tensorflow 2.7.0

  • Does the issue still exists with the last tfds-nightly package (pip install --upgrade tfds-nightly) ?
    Yes

Reproduction instructions

import tensorflow as tf
import tensorflow_datasets as tfds

ds_train = tfds.load(
    'iris', 
    shuffle_files=True,
    split=['train'],
    as_supervised=True,
)

assert isinstance(ds_train, tf.data.Dataset)

Link to logs
2022-03-05 13:27:35.574589: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "structured/iris.py", line 12, in
assert isinstance(ds_train, tf.data.Dataset)
AssertionError

Expected behavior
I expect assert isinstance(ds_train, tf.data.Dataset) to pass without AssertionError.

Additional context
N/A.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the Python reproduction with the stated TensorFlow and tensorflow-datasets versions, then inspect the object returned by tfds.load when split is passed as a list. Check the tfds.load documentation and related tests or implementation to determine the intended return type. Done means the reported behavior is either corrected or clearly covered by documentation and a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
api, data, machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.