cVladu opened a new issue, #13053:
URL: https://github.com/apache/tvm/issues/13053

   I tried converting a LSTM model from keras to relay IR
   
   ### Expected behavior
   The network is converted
   
   ### Actual behavior
   `relay.frontend.from_keras` fails with `AttributeError: 'LSTM_network' 
object has no attribute '_output_coordinates'`
   
   ### Environment
   Operating system:
   Distributor ID: Ubuntu
   Description: Ubuntu 18.04.6 LTS
   Release: 18.04
   Codename: bionic
   
   TVM version: 0.10.dev0 (commit b8cfc4ca8)
    Steps to build the TVM were followed from: 
https://tvm.apache.org/docs/install/from_source.html -- no change to 
config.cmake file
   
   ### Steps to reproduce
   ```
   import pytest
   import tensorflow as tf
   import numpy as np
   import tvm
   from tvm import relay
   
   @pytest.mark.parametrize("use_tensor_spec", [True, False])
   def test_frontend_from_keras(use_tensor_spec: bool):
   
       class LSTM_network(tf.keras.Model):
           def __init__(self, **kwargs):
               super().__init__(**kwargs)
               self.LSTM = tf.keras.layers.LSTM(30)
   
           if use_tensor_spec:
   
               @tf.function(
                   input_signature=[
                       tf.TensorSpec([None, 150, 20], dtype=tf.float32)
                   ]
               )
               def call(self, inputs):
                   return self.LSTM(inputs)
   
           else:
   
               def call(self, inputs):
                   return self.LSTM(inputs)
   
       model = LSTM_network()
       if not use_tensor_spec:
           model(np.random.rand(32, 150, 20))
       model.compile(optimizer="adam", loss="mse")
       model.fit(x=np.random.rand(32, 150, 20), y=np.random.rand(32, 1), 
epochs=1)
       mod, params = relay.frontend.from_keras(model)
       mod = relay.transform.InferType()(mod)
       # The network was converted
       assert True
   ```
   
   ### Triage
   
   * needs-triage
   
   
   If I am doing anything wrong, please let me know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to