'train_generator' is not defined

Can anyone help with this?

[code removed - moderator]

It seems like you are using an older version of the lab. In the latest version, this is the signature:
def train_happy_sad_model(train_generator):

In this case, you should be able to use train_generator.

In the assignment page, click Lab Help and Get latest version to get a fresh copy of the lab. Don’t forget to backup your work before refreshing the lab workspace.

1 Like

Changing train_generator to gen did the trick for the version I was using. As well restoring Line 39 to hist=train_happy_sad_model(). Thank you!!