'example_gen' is not defined

In the assigment “feature-engineering” in Week 2, I have this error, that it seems come from DeepLearning.AI, because it comes from a native function in the notebook:

“NameError: name ‘example_gen’ is not defined” in the cell number 6.

How can i solve the problem ?

Here’s a screenshot

Hello @Malfondet_Luc and welcome to DeepLearning Community, please check whether you have run all the cells up to where you’re getting the error?..

Please let me know. Thanks

If the error still persist try adding tfx.components like this

example_gen = tfx.components.CsvExampleGen(input_base=_data_root)

Happy Learning

Thanks you so much Isaak !
You saved my life !!!
It works, but i find strange that i have to do this thing.
For me it’s supposed to work without adding something to the code.

Welcome @Malfondet_Luc I guess maybe there’s some updates for TensorFlow but I will have a proper look on the Issue. Thank you

But i have the same kind of issue with the assignment: “Data Pipeline Components for Production ML”
In the cell number 4, i have this: “NameError: name ‘StatisticsGen’ is not defined”
and “tfx.components” doesn’t work this time…

It’s hard to point out what’s wrong, Would you please DM me the screenshot of the code and the error?

Hi , I am facing the same issue , and the above solution from @Isaak_Kamau solved my problem.
But is wierd that even after importing all the below components , we still get the problem
from tfx.components import CsvExampleGen
from tfx.components import ExampleValidator
from tfx.components import SchemaGen
from tfx.components import StatisticsGen
from tfx.components import Transform

Hi @Tanya1,

Welcome to the community!
What errors did you have? Please DM me the screenshot of your code, including the errors.