Error while converting saved model to mlir

I am trying to convert tensorflow saved model to mlir. I am using tensorflow/bazel-bin/tensorflow/compiler/mlir/tf-mlir-translate --savedmodel-objectgraph-to-mlir /path/to/saved_model -o out.mlir.

iam getting error as SavedModel import failed: Invalid argument: Exported function with exported name(s) ‘call’, ‘keras_api.call’ with multiple concrete functions. Add @tf.function(input_signature=[…]) on this function, or use a narrower list of exported names that excludes this function.

Thanks

/cc @Jacques_Pienaar

Hey Aruna,

Could you perhaps print the signatures in the SavedModel? I don’t know this import path so asking someone who knows better and will need to dig a bit. But the structure would help - I suspect one would need to specify tf-savedmodel-exported-names or the like to disambiguate although the message says to re-export with name disambiguated.

1 Like

I able to solve the issue by giving tf-savedmodel-exported-names.

Thanks

Hello
I am stuck with same issue. I tried use

--tf-savedmodel-exported-names=__call
__,__keras_api.__call__

, but it not help.
More interestingly, is that --tf-savedmodel-exported-names=<string> - Names to export from SavedModel, separated by ','. Empty (the default) means export all.

Can you share your command in shell? I’ll be really appreciate for this.