tensorflow / tensorflow/datasets

Unconsumed dataset iterator raises: AttributeError: 'NoneType' object has no attribute 'eager_mode'

Open
#3,946 0 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

Crash on exit.

  • OS: Ubuntu 22.04

  • Python version: 3.10

  • tensorflow-datasets 4.5.2

  • tensorflow 2.8.0

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

Reproduction instructions

import tensorflow_datasets as tfds
ds_map, info = tfds.load('iris', as_supervised=True, with_info=True, batch_size=1)
ds = ds_map['train']
dataset_iterator = iter(ds)

Produces

AttributeError: 'NoneType' object has no attribute 'eager_mode'

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 provided tfds.load('iris', ...) reproduction and creating an iterator without consuming it. Trace the iterator cleanup path from that entry point to identify why eager_mode is accessed on None; done means exiting without the AttributeError and preserving the reported dataset behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
data, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.