`mod.astext(show_meta_data=True)` didn't work on relay ir from keras model

Hi all~

I follow the tutorial of TVM Docs to get relay ir from Keras models. Then, I use mod.astext(show_meta_data=True) to save the relay structure with metadata.

weights_path = download_testdata(weights_url, weights_file, module="keras")
keras_resnet50 = tf.keras.applications.resnet50.ResNet50(
    include_top=True, weights=None, input_shape=(224, 224, 3), classes=1000
)
keras_resnet50.load_weights(weights_path)

shape_dict = {"input_1": data.shape}
mod, params = relay.frontend.from_keras(keras_resnet50, shape_dict)

text = mod.astext(show_meta_data=True)

However, it doesn’t work and I can only get the relay structure without metadata. I have ever saved relay with meta_data successfully on onnx model but this time I fail to do it on Keras models.

I give the reproduction script here.

Thanks in advance! :slight_smile:

I also want to know how to save the entire relay IR with metadata.

Wish some valuable comment, Thanks!

If meta data doesn’t appear it means the module doesn’t have meta data. You may want to use relay.save_param_dict(params) to save the params. It might be because of different handling in frontend, the params is not embed in the IR module in this case