Cell #3. Can't compile the student's code. Error: TypeError("__init__() missing 2 required positional arguments: 'op' and 'message'",)

Course: [3-data-pipelines-with-tensorflow-data-services]
Week 2, Programming Assignment, Transfer Learning

Here is my code and my output is exactly the same as expected but I am getting this error
Error:
"Cell #3. Can’t compile the student’s code. Error: TypeError(“init() missing 2 required positional arguments: ‘op’ and ‘message’”,)
"
Code:

EXERCISE: Split the dataset

splits = [‘train[:10%]’, ‘train[90%:95%]’, ‘train[95%:]’]

Remember to use cats_vs_dogs:4.*.*

cats_vs_dogs  |  TensorFlow Datasets

It has been downloaded for you so use the data_dir parameter

else it will try to download the dataset and give you an error here

splits, info = tfds.load(‘cats_vs_dogs’, split = splits, with_info=True)
(train_examples, validation_examples, test_examples) = splits

Testing lengths of the data if they are loaded correctly. Do not edit the code below

train_len = len(list(train_examples))
validation_len = len(list(validation_examples))
test_len = len(list(test_examples))
print(train_len)
print(validation_len)
print(test_len)

Hi Tayab, and welcome to the Forum! Based on the code comments, it looks like you forgot to use the data_dir argument. That’s usually the problem here. Hope it helps.

Thank you very much, Chris, it worked using your described solution!

1 Like

Great! Glad it worked!