# Image\_generator has incorrect type. Expected: typing.Callable, but got: \<class 'NoneType'\>

**URL:** <https://community.deeplearning.ai/t/image-generator-has-incorrect-type-expected-typing-callable-but-got-class-nonetype/106806>\
**Category:** Introduction to TF for Artificial Intelligence ...\
**Tags:** week-module-4\
**Created:** [March 8, 2022, 10:06pm UTC](https://community.deeplearning.ai/t/image-generator-has-incorrect-type-expected-typing-callable-but-got-class-nonetype/106806 "2022-03-08T22:06:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farnoosh\_Azour](https://avatars.discourse-cdn.com/v4/letter/f/f08c70/32.png) [@Farnoosh\_Azour](https://community.deeplearning.ai/u/Farnoosh_Azour)\
**Post date:** [March 8, 2022, 10:06pm UTC](https://community.deeplearning.ai/t/image-generator-has-incorrect-type-expected-typing-callable-but-got-class-nonetype/106806/1 "2022-03-08T22:06:40Z")

</div>

Hello everyone,  
I am trying to code the happy and sad image problem, but I do not understand what’s wrong with this code. Can anyone help me with that?

 ![image](https://global.discourse-cdn.com/dlai/original/2X/d/d597dbeefa4bb575e720ea1d2b2142e997674539.png)  
 ![image](https://global.discourse-cdn.com/dlai/original/2X/8/886dee56ba7fcd33ce1d7dcc0d660e1f6aca1d86.png)  
and the errors are:  
 ![image](https://global.discourse-cdn.com/dlai/original/2X/6/6b6118580ec175b414cf0c26d105359089a2ee6e.png)

Thank you very much for your help in advance.

Regards,  
Farnoosh

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [March 9, 2022, 6:27am UTC](https://community.deeplearning.ai/t/image-generator-has-incorrect-type-expected-typing-callable-but-got-class-nonetype/106806/2 "2022-03-09T06:27:20Z")

</div>

Based on this notebook [tensorflow-1-public/C1W4\_Assignment.ipynb at main · https-deeplearning-ai/tensorflow-1-public · GitHub](https://github.com/https-deeplearning-ai/tensorflow-1-public/blob/main/C1/W4/assignment/C1W4_Assignment.ipynb)

seems like the function takes in `train_generator` as a parameter. Did you modify the function signature?

One more thing. Rename `f = train_happy_sad_model()` to whatever was there originally.

Could you [Refresh your notebook](https://www.coursera.support/s/article/360004995312-Solve-problems-with-Jupyter-Notebooks?language=en_US#-5) and reply on how things go?

Please remove references to code in your post.
