info of .pb file
The shape of the input and output are needed to use a machine learning model. In a case where only a .pb
file is available and the source code can’t be checked, there are a few ways to get information about
the model from the .pb
file.
loading the model I used this script by itself and it shows the node names. But it doesn’t help me since I need to know the shapes of the input and output… I can’t do anything with these information. It’s good to know info can be extracted this way though.
saved_model_cli
This way seems to be the best way to find the i/o shapes but when I tried using it, it needed extra
files that I don’t have. My guess is that it assumes the processed model is saved with the current
version of tensorflow where it has other files other than the .pb
file. So it gave a bunch of errors saying
it need the extra files.
I tried using it the second time using a python virtual environment, it didn’t give any errors but it didn’t show any output either.