How to include python files in tensorflow package build?

I want to use the following file :

from tensorflow.python.grappler import model_analyzer

But tensorflow by default does not have the model_analyzer.py in pip packages. I can’t find the file under .../envs/tfenv/lib/python3.8/site-packages/tensorflow/python/grappler/.

However, the model_analyzer.py is indeed under the tensorflow’s source directory at /tensorflow/tensorflow/blob/master/tensorflow/python/grappler/model_analyzer.py

Why tensorflow ignores these files under grappler directory? How should I build tensorflow for using these files?

1 Like

I’m assuming that you need to analyze the model, as seen on file name.
I don’t know is it just the same things as TFMA but since the beginning I’ve been using TFMA for model analyzer. If you want to give it a try, you can install it with;
pip install tensorflow-model-analysis
Hope it helps.

1 Like

Thanks for the reply!
Actually, I want a slightly different with this. Because I want to modify some code and compile it to see what happens. So that’s why I cannot just use the pip package.

1 Like