Failed test case: create_train_val_dirs has incorrect type

Hi, my functions give the outputs they are supposed to but when I submit the notebook for grading I get the following errors:
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’>.

Training History
Filename: Training History
50/50Score: 50 of 50
Show grader output

January 12, 2023 12:08 PM EST
Submitted at: Jan 12, 12:08 PM EST
50/100

Score: 50 of 100
NoAssignment not passed

Graded Functions
Filename: Graded Functions
0/50Score: 0 of 50
Hide grader output
Grader output
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’>.

Could anyone help me with the issue?

Hello @Jae_Kim ,

Welcome to the community!!

Try getting a fresh workspace.

Here’s a link with a similar issue.Go through This

With regards,
Nilosree Sengupta

Thank you for your response!

I actually did try refreshing the workspace but it still wouldn’t work…
Could you possibly look at my notebook by any chance and see what’s wrong?

Thank you so much,
Jae

Hello @Jae_Kim ,

Yeah sure!

Send me your notebook via dm such that I can check where it went wrong.By clicking on the profile picture, you will see an option to message.There you can attach your notebook. Then we can discuss the issues here, under the topic you created.

With regards,
Nilosree Sengupta

Hello @nilosreesengupta and @Jae_Kim I am constantly facing the problem while submission
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’>.

C2W1_Assignment.ipynb (43.1 KB)

Hello @nilosreesengupta @Jae_Kim I am still waiting for your reply.

Hello @KALLOL_ROY ,

There are mistakes in every function. I am explaining you one by one here.

1ST Function: create_train_val_dirs

2ND Function : split_data

3RD Function : train_val_generators

Under : Instantiate the ImageDataGenerator class (don’t forget to set the rescale argument)

  1. Rescale should be floating point
  2. Batch_size is wrong

4TH Function : create_model

Hint is given:

Complete the create_model function below which should return a Keras’ Sequential model.
Aside from defining the architecture of the model, you should also compile it so make sure to use a loss function that is compatible with the class_mode you defined in the previous exercise, which should also be compatible with the output of your network. You can tell if they aren’t compatible if you get an error during training.
Note that you should use at least 3 convolution layers to achieve the desired performance.

  1. Half part is correct, but you have taken too many layers.
  2. Optimizer is wrong.
  3. And several Parameters are not correct.

I would suggest you to go through the lessons properly.

Hope this helps.

With regards,
Nilosree Sengupta

1 Like

Thanks, @nilosreesengupta for the support. The issue is solved now.

Hello @KALLOL_ROY ,

You’re welcome!!
Happy learning!!

With regards,
Nilosree Sengupta