What does mean Python inputs incompatible with input_signature

  python, tensor, tensorflow2.0

I am getting the issue

ValueError: Python inputs incompatible with input_signature:

When I do :

image_np = np.asarray(np.array(Image.open(image_path)))
input_tensor = tf.convert_to_tensor(image_np)
input_tensor = input_tensor[tf.newaxis, ...]
detections = detect_fn(input_tensor)

the issue happen precisely on this line :

detections = detect_fn(input_tensor)

What am I doing wrong ? What does this error mean ?

Console Log

ValueError: Python inputs incompatible with input_signature:
  inputs: (
    tf.Tensor(
[[[[255 255 255 255]
   [255 255 255 255]
   [255 255 255 255]
   ...
   [255 255 255 255]
   [255 255 255 255]
   [255 255 255 255]]

  [[254 254 254 255]
   [255 255 255 255]
   [255 255 255 255]
   ...
   [255 255 255 255]
   [255 255 255 255]
   [255 255 255 255]]

  [[254 254 254 255]
   [254 254 255 255]
   [255 255 255 255]
   ...
   [255 255 255 255]
   [255 255 255 255]
   [255 255 255 255]]

  ...

  [[ 37  37  37 255]
   [ 37  37  37 255]
   [ 39  39  39 255]
   ...
   [ 32  32  32 255]
   [ 33  33  33 255]
   [ 31  31  31 255]]

  [[ 37  37  37 255]
   [ 38  38  38 255]
   [ 36  36  36 255]
   ...
   [ 33  33  33 255]
   [ 31  31  31 255]
   [ 32  32  32 255]]

  [[ 38  38  38 255]
   [ 37  37  37 255]
   [ 38  38  38 255]
   ...
   [ 32  32  32 255]
   [ 31  31  31 255]
   [ 32  32  32 255]]]], shape=(1, 1080, 1915, 4), dtype=uint8))
  input_signature: (
    TensorSpec(shape=(1, None, None, 3), dtype=tf.uint8, name='input_tensor'))

Source: Python Questions

One Reply to “What does mean Python inputs incompatible with input_signature”

LEAVE A COMMENT