Expected: typing.Callable, but got: <class 'NoneType'> C2_W1

I am getting the following error (which is NOT explanatory) for all the functions in the assignment:

Details of failed tests for create_train_val_dirs

Failed test case: create_train_val_dirs has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for split_data

Failed test case: split_data has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for train_val_generators

Failed test case: train_val_generators has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for create_model

Failed test case: create_model has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

My history.pkl passed the grading 50/50 but the file.ipynb failed 0/50!
Does anyone know how to fix this?
I also copied and pasted the whole file into a new file in my colab but it did not help!
Cheers,

Hello @mrgransky ,
Some people faced the same problem but in a different week of the course, the problem is usually in the first function because the following functions depend on it.

Check this thread, and if you don’t find any helpful information, click my name and send me your .ipynb file in a private message and I’ll see what’s wrong.
Expected: typing.Callable, but got: <class ‘NoneType’> - TF1 Course 2 / TF1 Course 2 Week 4 - DeepLearning.AI

Hi @mrgransky, you will find the solution in the thread that @m.abidat pointed out but to avoid having to scroll through it, here is the solution:

this error is most likely being caused because we updated the graders recently to allow the use of global scope.

Could you try getting the latest version of the assignment? To do this, visit the link provided in the classroom which should redirect you to colab. This new version of the assignment contains some extra metadata required for grading, so create a copy of it and on this new version (which should be blank) copy and paste your solution, check that everything is running correctly (you can also try submitting without running since the training usually takes a long time), download your notebook and submit for grading.

1 Like

Hi @Vignesh_B, thanks for reaching out.
As @a-zarta explained, the solution is quite simple. Just make sure you have the latest version of the assignment.

Here’s the link for the notebook: https://colab.research.google.com/github/https-deeplearning-ai/tensorflow-1-public/blob/main/C2/W1/assignment/C2W1_Assignment.ipynb

Waiting for your feedback :smile:

Working on the new_file.ipynbfrom github fixes the problem.
I used the previous files and they caused the errors.
Cheers,

Have fun with the rest of the course!