When setting a tensor for a model I have converted to tf.lite from keras I get the error ValueError: Cannot set tensor: Dimension mismatch. Got 416 but expected 1 for dimension 1 of input 0.
The input sample is an three channel image with shape (1, 416, 416, 3)
The input details got from the interpreter are:
{‘name’: ‘serving_default_input_2:0’,
‘index’: 0,
‘shape’: array([1, 1, 1, 3]),
‘shape_signature’: array([-1, -1, -1, 3]),
‘dtype’: numpy.uint8,
‘quantization’: (0.003921568859368563, 0),
‘quantization_parameters’: {‘scales’: array([ 0.0039216], dtype=float32),
‘zero_points’: array([0]),
‘quantized_dimension’: 0},
‘sparsity_parameters’: {}}
test_image_.shape
The shape signature matches the image, but the interpreter shape is wrong. Any ideas why the tf.lite model got this parameter wrong?
Thanks,
Juan