Open kyakuno opened 2 months ago
With tensorflow-macos Version: 2.12.0, the ImageEncoder cannot be inferred.
File "/Users/kyakuno/Desktop/ailia/ailia-models-tflite/image_segmentation/segment-anything-2/sam2_image_predictor.py", line 30, in set_image
image_encoder.allocate_tensors()
File "/usr/local/lib/python3.11/site-packages/tensorflow/lite/python/interpreter.py", line 507, in allocate_tensors
return self._interpreter.AllocateTensors()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Given shapes, [1,255,256,144] and [1,256,256,144], are not broadcastable.Node number 204 (ADD) failed to prepare.Failed to apply the default TensorFlow Lite delegate indexed at 0.
With tensorflow Version: 2.17.0, it can be inferred.
tflite's output tensor order becomes random.
Support for the Tiny model has been added.
python3 segment-anything-2.py --model_type hiera_t --tflite
Image mode (TensorFlow)
Video mode(TensorFlow)
As a constraint, TensorFlow does not support DynamicShape, so the specified point becomes one.
88