1

I am working with https://github.com/tensorflow/models/tree/master/research/object_detection, where I have loaded the following model using pipeline config:

import tensorflow as tf
from object_detection.utils import config_util
from object_detection.builders import model_builder

tf.keras.backend.clear_session()
pipeline_config = 'models/research/object_detection/configs/tf2/ssd_resnet50_v1_fpn_640x640_coco17_tpu-8.config'
configs = config_util.get_configs_from_pipeline_file(pipeline_config)
model_config = configs['model']
detection_model = model_builder.build(model_config=model_config, is_training=False)

detection_model.summary()  # AttributeError: 'SSDMetaArch' object has no attribute 'summary'

I have also tried restoring the weights / variables, but to no avail

image, shapes = detection_model.preprocess(tf.zeros([1, 640, 640, 3]))
prediction_dict = detection_model.predict(image, shapes)
detection_model.postprocess(prediction_dict, shapes)

for variable in detection_model.variables:
    variable.summary()  # Throws AttributeError, since none of these have .summary()

I have tensorflow version 2.10.1.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.