C4W2_Assignment Can't load datasets due to ERROR

When I try to load the dataset with:
train_dataset = tfds.load(‘cifar10’, as_supervised=True, split=“train”)
I get the following StackTrace:

ImportError Traceback (most recent call last)
in <cell line: 16>()
14
15 # use tfds.load() to fetch the ‘train’ split of CIFAR-10
—> 16 train_dataset = tfds.load(‘cifar10’, as_supervised=True, split=“train”)
17
18 # preprocess the dataset with the map_image() function above

14 frames
/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/dataset_ops.py in interleave(self, map_func, cycle_length, block_length, num_parallel_calls, deterministic, name)
2425 state_structure = structure.type_spec_from_value(initial_state)
2426
→ 2427 # Iteratively rerun the reduce function until reaching a fixed point on
2428 # state_structure.
2429 need_to_rerun = True

ImportError: cannot import name ‘interleave_op’ from ‘tensorflow.python.data.ops’ (/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/init.py)


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
“Open Examples” button below.

But I couldn’t figure out how to install the missing package!

Did you try

pip install tensorflow --upgrade
pip install keras --upgrade

or try refreshing your notebook assignment and then run the cell

Also make sure you have run all the cells before one by one

sure i ran the installation of versions 2.8.0 I will try again as soon I get an gpu

if you were able to install tensorflow 2.8 version that ops error should not come. Please make sure to refresh your coursera page assignment where you click the assignment link which open to the Colab assignment. Make sure your gpu is properly connected without any network issue while you are running these cells.

Okay don’t have a gpu but now it works

1 Like

Glad it worked out.

Happy Learning!!!