Error: TypeError("__init__() missing 2 required positional arguments: 'op' and 'message'",)

I’m having the same problem and I’ve specified the dataPath in the tfds load.

Everything runs fine in my environment.

Note that there are three places to add the explicit datafile path, the first two loads in cell 3 and the information load in cell 5.

1 Like

I had the same problem. Just find every load function and you shouldn’t have any more problems! Thanks @tech_dog

Hey Mentor
C3_Data-pipelines/W2/assignment/C3_W2_Assignment.ipynb.
my code can pass Coursera- Jupyter , but failed in the submission get the following error. it looks like the two environments are diff. can you help check and adivise?

Cell #3. Can’t compile the student’s code. Error: TypeError(“init() missing 2 required positional arguments: ‘op’ and ‘message’”,)

Thanks for the thread and suggested fixes. I have the same issue now. Code executes fine in notebook but fails in the grader, and the fail messages are inconsistent.But I have got 2 of the same errors as you. However i was already specifying data_dir parameter in the tfds load() function (data_dir='{filepath}).

I am in the process of removing all the helper print functions that i had, in case this breaks the grader…

Was there any other avenue worth exploring, or do you still think the grader is incompatible with the code version in the notebook?

One other thing to add.

The line : data_dir=‘{filepath}’ works in the jupyter notebook, although copilot says it is incorrect.

The line : but data_dir=filepath does not work in jupyter (the functino will not compile)

Which one is correct for this version of jupyter and everything else?
Many thanks in advance.

and i tried it with " " too, and even though it compiled in jupyter notebook, the grader would not accept it with…
Cell #3. Can’t compile the student’s code. Error: NameError(“name ‘filepath’ is not defined”,)

So 2 and ONLY 2 parameters right? Even though the tensorflow documentation (tfds.load  |  TensorFlow Datasets)

indicates that the following parameters are NOT optional:

data_dir:
shuffle_files:
download:
as_supervised:
with_info:
try_gcs:

Thanks for any response!

I am away on vacation now, but if you are doing the assignment outside coursera my feedback above may not be valid.