tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.74k stars 769 forks source link

Enabling NEON for TFLM on Raspberry Pi #2590

Closed Uwaang closed 1 month ago

Uwaang commented 1 month ago

I am trying to enable the NEON option for TFLM on a Raspberry Pi. I removed '-DTF_LITE_DISABLE_X86_NEON' and added '-DUSE_NEON' to COMMON_FLAGS in 'tensorflow/lite/micro/tools/make/Makefile'. Is this the correct way to enable NEON for TFLM?

ddavis-2015 commented 1 month ago

@Uwaang

TFLM does not support NEON optimization. For Arm targets, TFLM supports CMSIS_NN.

Since you are using a Raspberry Pi, TensorFlow Lite (TfLite) should be available to you. The default configuration has NEON support, and several kernels use NEON by default. When instantiating your tf.lite.Interpreter be sure to pass the parameter experimental_op_resolver_type=tf.lite.experimental.OpResolverType.AUTO or experimental_op_resolver_type=tf.lite.experimental.OpResolverType.BUILTIN in order to use kernels supporting NEON.

For any additional questions or issues with TensorFlow Lite (TfLite) please submit a new issue to the TensorFlow repository.