New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFLite: Stable Delegate: how to use stable_delegate with python API #66632
Comments
Hi @sushreebarsa |
@suyash-narain
then Open the stable_delegate_settings.json file:
Thank you! |
Hi @sushreebarsa So do I need to specify this 'settings' somewhere in my python code, or will the delegate automatically get loaded and execute the tflite model? since interpreter api loads external shared delegate library .so files using tfltie experimental load_delegate function... i mean, in the below format, how will i add this settings file after its parsed?
secondly, stable delegate does not make use of tflite_plugin_create_delegate or tflite_plugin_destroy_delegate since it has its own stable delegate settings... but if i pass it through python interpreter api, it forces it to search for tflite_plugin_create_delegate or tflite_plugin_destroy_delegate. do you know of a workaround to make stable delegate work with python? thanks |
@suyash-narain If you're using a custom delegate library with its own settings, follow the TFLite delegate loading documentation to incorporate it. There isn't a well-established workaround to directly use the stable delegate with the Python API for TFLite. |
I am using tflite 2.16.1
My target is an aarch64 linux system
I have a tflite stable_delegate .so shared library, and a stable_delegate settings json file called 'stable_delegate_settings.json which I can execute using TFLite benchmark model using the commands
./benchmark_model --graph=model.tflite --stable_delegate_settings_file=stable_delegate_settings.json
this executes the model using stable delegate through the json stable_delegate settings file.
I want to know how can I use this stable_delegate_settings.json file to execute the model via stable delegate using python API.
I am not sure whats the format to execute stable delegate using tflite.load_delegate, since it searches for the .so shared library, not the json settings file.
thanks
The text was updated successfully, but these errors were encountered: