Expected: <class 'keras.engine.training.Model'>, but got: <class 'NoneType'>

Hello! I have problems with my assignment! My code is working correctly, but I have this feedback:

This is screenshot of my code from notebook. I don’t understand what’s wrong… Help me please.


1 Like

Have you imported any of these:

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers

Try using for e.g. keras.layers instead, it might be that the tests expect a certain kind of class rather than another one.

Hi @vika.babenko.18.09.0 , this error is probably being caused because we updated the graders recently to allow the use of global scope.

Initial post had some info that was not accurate, so editing it:

Could you try getting the latest version of the assignment? To do this:

  • Click in the jupyter logo in the upper left corner of the screen. This will take you to the jupyter filesystem.
  • Here, download your notebook so you don’t lose any progress.
  • After downloading the nb, delete it.
  • Then click on Help and Get Latest Version
  • Copy and paste your code into this blank assingment and save it before submitting.

i have tried what you said before and the end result is 4,0009
but when I send it to be rated I still get 0 and I have tried many times. What’s wrong?

Did you try the sugesstion above from staff.

Yes of course. I have upgraded the notebook into the new version. But it still same :frowning:

Please follow these steps to get the latest version of the assignment and try again:

  1. O​pen the notebook from the classroom.
  2. After the notebook opens up, c​lick File → Open
  3. W​hen your workspace opens, tick the check box before your notebook file. After it is selected, press Shutdown. The icon beside the filename should turn from green to gray.
  4. Tick the checkbox again and this time choose Rename and enter any filename other than the original. For example, C4W1_Assignment.ipynb (original) → C4W1_Assignment_v2.ipynb
  5. (Optional) Tick the checkbox of any other file that you want to get a fresh copy of (e.g. dataset files that you might have manipulated irreversibly). Then click Delete . You can also opt to Rename or Download each file individually in case you want to keep them before deleting.
  6. Click on the Help button on the top right of the page.
  7. Click the Get latest version button.
  8. Click the Update Lab button. The page will refresh and you should now see the latest version of the notebook.



Hello. I followed all these steps but in vain. I still get 0.