MLIR intermediate representation of a tensorflow model

Hi! Can anyone guide me the process of converting a tensorflow model in to MLIR. I’m using:
iree-import-tf saved_model/ -o output.mlir
Where I’ve generated the saved model direcotory using:

import tensorflow as tf
import tensorflow_hub as hub
# Download the pre-trained model from TensorFlow Hub
model_url = "https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/4"
model = hub.load(model_url)
# Save the model in the SavedModel format
tf.saved_model.save(model, "saved_model/")

But when I use mlip-opt view-ir on the generated output.mlir using iree-import-tf, it gives me no output:

./mlir-opt --print-ir output.mlir
// -----// IR Dump //----- //
module {
}
module {
}

Can anyone guide me how can I get the MLIR intermediate representation of a model.

Hi @taalhaataahir0102,

Since you are using the iree compiler (which is not a part of the llvm project), I encourage you to ask it on one of the iree-specific channels: IREE

1 Like