Grader can't compile the code

I am getting the following error after submitting my assignment.

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

But in the Lab It runs totally fine.

I have not taken any of the TF specializations, but let’s reason about this as scientists: so something is different about what the grader sees. How might that happen? Here are some possible reasons I can think of:

  1. Your code is not general, meaning that you do things like reference global variables from the local scope of your functions.
  2. I’ve seen cases in a number of courses in which the versions of the packages (TF, or various libraries) that the grader uses is older than the one used in the notebooks. So perhaps you have a “versionitis” problem.
  3. In some assignments, clicking “Submit” does not do an automatic “Save” for you. So if you have changed the code since the last time you hit “Save”, the grader may see an older version of your code. So WYS (what you see) is not necessarily WTGG (what the grader gets).

To test whether option 3) is the cause, try this:

  1. Kernel → Restart and Clear Output
  2. Cell → Run All and check that the tests still pass
  3. Save
  4. Submit

If that’s not the correct theory, then investigate option 1) with particular attention to where “init()” is referenced.

If that’s not it, then try option 2), but that one may be a bit tricky and require attention from one of the TF mentors.

Good luck!

Try to remove the parentheses for the splits, that works for me

I tried that too, but still the error is same can you send me your notebook, if possible

or the problem might be with splits variable? i mistook it as splits for the tfds load parameter. just hardcode the split param and leave splits variable empty

Thanks that worked for me