keras-nlp
keras-nlp copied to clipboard
ModuleNotFoundError: No module named 'keras_nlp.api_export'
ModuleNotFoundError: No module named 'keras_nlp.api_export'
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
Define your model and concrete function here
model_beam_search = ...
concrete_func = model_beam_search.call.get_concrete_function()
Create a TFLite converter and set the delegate to TfLiteGpuDelegate
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]
Replace TfLiteFlexDelegate with TfLiteGpuDelegate
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()
Save the TFLite model to a file
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
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.