iree: TF importer doesn't work with Keras model

What happened?

Got

tensorflow/compiler/mlir/tensorflow/transforms/xla_cluster_formation.cc:74] no entry function is found

when trying to import a keras model

Steps to reproduce your issue

import tensorflow as tf
from iree.compiler import tf as tfc

inputs = tf.keras.Input(shape=(32, 32, 3))
resnet = tf.keras.applications.ResNet50(weights='imagenet',
                                        include_top=True, input_tensor=inputs)

resnet.save("/tmp/resnet50")

loaded_model = tf.saved_model.load("/tmp/resnet50")
print(loaded_model.signatures.keys())

compiler_module = tfc.compile_saved_model("/tmp/resnet50", import_only=True, exported_names="serving")

We can see the serving signature is there, but it still fails to compile.

What component(s) does this issue relate to?

Frontends

Version information

6a46afd4f82715979b54c57fb41a8505466cd68f

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

I think I’ve been down this road before, assuming that the message tensorflow/compiler/mlir/tensorflow/transforms/xla_cluster_formation.cc:74] no entry function is found was an error, but it is a warning and processing continues. I told the TF team responsible about this but they didn’t want to prioritize any fixes.

When I encountered this, I wasted a lot of time assuming that my original incantations were wrong, when in fact the original ones were right and were just printing this warning.

Sorry about all of this. We are on the verge of just calling TensorFlow unsupported due to the owners not really paying any attention to their export APIs.