I am trying to freeze a model I trained based on a model from the Tensorflow Model Zoo but cannot figure out how to.

Things I have tried:




Used exporter_main_v2.py (models/exporter_main_v2.py at master · tensorflow/models · GitHub 1), as outlined in: TFODCourse/2. Training and Detection.ipynb at main · nicknochnack/TFODCourse · GitHub.
This caused the warning:
WARNING:tensorflow:Skipping full serialization of Keras layer <keras.layers.core.lambda_layer.Lambda object at 0x7fa3b11775d0>, because it is not built.
To be printed numerous times and the final result wasn’t readable when I tried to pass it into:
cv.dnn.readNetFromTensorflow




Tried to use freeze_graph.py, however one of the required parameters is the output node and I am unable to figure out how to get the output nodes from the model. Do note the model also does not have a .meta file. Here is a an image of the model’s directory structure for reference:

Model Used:
ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8
Training Script Used:
model_main_tf2.py

Image of directory:

Capture555×512 19.7 KB

freeze: contains the result of running exporter_main_v2.py
pre-trained: contains the model downloaded from tf2 model zoo
trained: contains the result of running the mode_main_tf2.py training script

If there is anymore information you need please let me know, I am new to this.