google-ai-edge / LiteRT

LiteRT is the new name for TensorFlow Lite (TFLite). While the name is new, it's still the same trusted, high-performance runtime for on-device AI, now with an expanded vision.
https://ai.google.dev/edge/litert
Apache License 2.0
169 stars 14 forks source link

Having non-converted operations, even for simplest models #84

Open gaikwadrahul8 opened 4 days ago

gaikwadrahul8 commented 4 days ago

System information

Steps to reproduce

model = tf.keras.models.Sequential([ tf.keras.layers.InputLayer(input_shape=(1,)), tf.keras.layers.Dense(1) ])

converter = tf.lite.TFLiteConverter.from_keras_model(model) tflite_model = converter.convert()

with open('model.tflite', 'wb') as f: f.write(tflite_model)


- Calling it in Jupyter Notebook by `!python test.py`
- The output will be:

```Python
2024-01-28 11:17:11.939381: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-01-28 11:17:11.939450: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-01-28 11:17:11.941203: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-01-28 11:17:13.646897: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-01-28 11:17:16.713671: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:378] Ignored output_format.
2024-01-28 11:17:16.713736: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:381] Ignored drop_control_dependency.
Summary on the non-converted ops:
---------------------------------
 * Accepted dialects: tfl, builtin, func
 * Non-Converted Ops: 1, Total Ops 6, % non-converted = 16.67 %
 * 1 ARITH ops

- arith.constant:    1 occurrences  (f32: 1)

  (f32: 1)

Note: running the code directly in Jupyter Notebook won't print anything

Problem

gaikwadrahul8 commented 3 days ago

This issue originally reported by @Black3rror has been moved to this dedicated repository for LiteRT to enhance issue tracking and prioritization. To ensure continuity, we have created this new issue on your behalf.

We appreciate your understanding and look forward to your continued involvement.