You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2 properties of a tensor (in TensorFlow) are the rank and shape. Right now, when using the TensorFlow predictor, only the 2 following kinds of tensors are supported:
Tensors with known rank and shape. Such as (3, 224, 224).
Tensors with known rank and unknown shape. Such as (3, -1, -1).
Reproduce
When tensors have the following properties, the validation will fail, when in reality, it shouldn't:
Tensors with no rank and empty shape - for scalars. Such as ().
Tensors with unknown rank and shape. Such as (-1, -1, -1, ...).
When an input tensor has the above properties, the following error pops up the logs cortex logs <api-name>.
Traceback (most recent call last):
File "/src/cortex/serve/serve.py", line 282, in start_fn
tf_serving_host=tf_serving_host, tf_serving_port=tf_serving_port
File "/src/cortex/lib/type/predictor.py", line 72, in initialize_client
client = TensorFlowClient(tf_serving_address, self.models)
File "/src/cortex/lib/client/tensorflow.py", line 48, in init
self._signatures, get_model_signature_map(models)
File "/src/cortex/lib/client/tensorflow.py", line 186, in extract_signatures
signature_defs[model_name], signature_keys[model_name], model_name,
File "/src/cortex/lib/client/tensorflow.py", line 246, in extract_signature
"shape": [int(dim["size"]) for dim in input_metadata["tensorShape"]["dim"]],
KeyError: 'dim'
Additional
References that show that no-rank/no-shape and scalar tensors do indeed exist and are used:
RobertLucian
changed the title
Support scalar and no-rank/no-shape tensors when using the TensorFlow predictor
Fix scalar and no-rank/no-shape tensor validation when using the TensorFlow predictor
Aug 27, 2020
Description
2 properties of a tensor (in TensorFlow) are the rank and shape. Right now, when using the TensorFlow predictor, only the 2 following kinds of tensors are supported:
(3, 224, 224
).(3, -1, -1)
.Reproduce
When tensors have the following properties, the validation will fail, when in reality, it shouldn't:
()
.(-1, -1, -1, ...)
.When an input tensor has the above properties, the following error pops up the logs
cortex logs <api-name>
.Additional
References that show that no-rank/no-shape and scalar tensors do indeed exist and are used:
The text was updated successfully, but these errors were encountered: