C3_W3_Lab_2_OxfordPets-UNet

Hi,
I encounter a problem in ungraded lab when downloading the dataset of Oxford pet data, it was upgraded from version 3.x to 4.0.0 and I changed the code but still it gives me error message. A little help will appreciate thanks

If you hit a problem with checksums, you can execute the following line first

!python -m tensorflow_datasets.scripts.download_and_prepare --register_checksums --datasets=oxford_iiit_pet

download the dataset and get info

#dataset, info = tfds.load(‘oxford_iiit_pet’, with_info=True)

Load the dataset

dataset, info = tfds.load(‘oxford_iiit_pet’, with_info=True)

NotImplementedError Traceback (most recent call last)
in <cell line: 7>()
5 #dataset, info = tfds.load(‘oxford_iiit_pet’, with_info=True)
6 # Load the dataset
----> 7 dataset, info = tfds.load(‘oxford_iiit_pet’, with_info=True)

33 frames
/usr/local/lib/python3.10/dist-packages/tensorflow_datasets/core/file_adapters.py in make_tf_data(cls, filename, buffer_size)
265 ) → tf.data.Dataset:
266 “”“Returns TensorFlow Dataset comprising given array record file.”“”
→ 267 raise NotImplementedError(
268 ‘.as_dataset() not implemented for ArrayRecord files. Please, use’
269 ’ .as_data_source().’

NotImplementedError: .as_dataset() not implemented for ArrayRecord files. Please, use .as_data_source().

based on your error, it is stating you are suppose to use tfds.data_source( ) instead of tfds.load to use the oxfordpets source file.

Also make sure when you run assignment codes, the datasets are downloaded locally in the main drive

Regards
DP

When i use tfds.data_source() then it is not behave as it should be e.g i can’t perform dataset.keys() it gives me error

kindly see for your self this lab as it should be upgraded by now the code in this lab doesn’t work now due some upgradation.

can I know if you are running the lab in course provided environment?

The issue could also be due tensorflow and keras version discrepancy. can you tell me which version it is running?

can you share a screenshot of the error you got with as.data_source??

yes i use the same provided environment and following the protocols it seems the code should be update as it doesn’t work



loading the dataset with .data_source doesn’t behave as it should

hi @Sajjad_Ali

please check the colab notebook in the course environment is running on which version or

Learners can reload the colab from the classroom or just add these lines at the top of their existing notebook (then run everything again to generate a new model file):

!pip install tf-keras==2.15 --quiet
!pip install tensorflow==2.15 --quiet
!pip install keras==2.15 --quiet

So that the colab lab runs in the version it was created.

Let me know if it still throws error.

Regards
DP

nothing change, it throws the same error

@Sajjad_Ali

when I opened the lab my codes were like this :point_down:t2:

# If you hit a problem with checksums, you can execute the following line first
!python -m tensorflow_datasets.scripts.download_and_prepare --register_checksums --datasets=oxford_iiit_pet:3.1.0

# download the dataset and get info
dataset, info = tfds.load('oxford_iiit_pet:3.*.*', with_info=True)

was your code also same? as in the post created topic I see 3.1.0 being removed in your msg. can you confirm this please

yes the reason i removed 3.. is because the dataset is updated and it gives me error

please don’t make any changes.

if you have edited out the codes, then refresh the notebook environment, to get its original form and then first check in the colab on which version of tensorflow, keras and tf- keras colab notebook is working on.

So if you get 2.17 version

then add

!pip install tf-keras==2.17 --quiet
!pip install tensorflow==2.17 --quiet
!pip install keras==2.17 --quiet

so the codes run in the version it was created.

when i refresh the notebook to its original code and added the above installation this is usual error i get

1 Like

@Sajjad_Ali

I have informed the staff about this issue. Kindly wait for his response.

Regards
DP

1 Like

Got the same error, looking forward for solution or different way to load the dataset

1 Like

Hi everyone! Thank you for reporting this. There is an issue with TFDS and the workaround for now is to downgrade it to a previous version. You can reopen the notebook from the classroom to see the changes. Alternatively, you can add this line up top before importing the packages:

!pip install tensorflow_datasets==4.9.3

You can also comment out the code that registers the checksum because it won’t throw any error anymore.

# !python -m tensorflow_datasets.scripts.download_and_prepare --register_checksums --datasets=oxford_iiit_pet:3.2.0

After that, the notebook should run without error. Hope this helps!

2 Likes