Open Alwaysadil opened 1 year ago
Can you give any more details?
A colab reproduction would be the most helpful.
@mattdangerw actually my problem was related to download or install libtensorflowlite_gpu_delegate.so file in google colab and i am using tf version of 2.13.0 please help me to get that for adding that at tflite conversion for getting high performance(faster inference) i'm using this below code for tflite conversion import tensorflow as tf
concrete_func = model_beam_search.call.get_concrete_function()
converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func], model_beam_search) converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS, tf.lite.OpsSet.SELECT_TF_OPS] converter.optimizations = [tf.lite.Optimize.DEFAULT]
gpu_delegate = tf.lite.experimental.load_delegate('libtensorflowlite_gpu_delegate.so') converter.experimental_new_converter = True # This flag is needed for using the experimental converter converter.experimental_new_quantizer = False # You can enable quantization if needed converter.experimental_enable_resource_variable = False # You can enable resource variables if needed converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS, gpu_delegate]
tflite_model = converter.convert()
with open('testing_gpu.tflite', 'wb') as f: f.write(tflite_model)
@Alwaysadil , Could you please try with the latest version of TensorFlow and Keras-NLP and let us know the outcome. Thanks
ModuleNotFoundError: No module named 'keras_nlp.api_export'