I was successful in running the inference for TensorFlow Hub Object Detection Colab on google colab
the model I have loaded
model_display_name = 'CenterNet HourGlass104 Keypoints 512x512'
model_handle = 'https://tfhub.dev/tensorflow/centernet/hourglass_512x512/1'
Trying to use Transfer learning with TensorFlow Hub
IMAGE_SHAPE = (None, None)
classifier = tf.keras.Sequential([
hub.KerasLayer(model_handle, input_shape=IMAGE_SHAPE+(3,))
])
I get this error
ValueError Traceback (most recent call last)
<ipython-input-23-081693dbe40a> in <module>()
4
5 object_detector = tf.keras.Sequential([
----> 6 hub.KerasLayer(object_detector_model, input_shape=Object_Detector_IMAGE_SHAPE+(3,))
7 ])
2 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs)
690 except Exception as e: # pylint:disable=broad-except
691 if hasattr(e, 'ag_error_metadata'):
--> 692 raise e.ag_error_metadata.to_exception(e)
693 else:
694 raise
ValueError: Exception encountered when calling layer "keras_layer" (type KerasLayer).
in user code:
File "/usr/local/lib/python3.7/dist-packages/tensorflow_hub/keras_layer.py", line 229, in call *
result = f()
ValueError: Python inputs incompatible with input_signature:
inputs: (
Tensor("Placeholder:0", shape=(None, 1, None, None, 3), dtype=float32))
input_signature: (
TensorSpec(shape=(1, None, None, 3), dtype=tf.uint8, name=None)).
Call arguments received:
• inputs=tf.Tensor(shape=(None, 1, None, None, 3), dtype=float32)
• training=None
How do I alter IMAGE_SHAPE for this, I am confused?
Need help, thank you