lostella commented on issue #12783: Name conflict when serializing 
HybridSequentialRNNCell
URL: 
https://github.com/apache/incubator-mxnet/issues/12783#issuecomment-428921900
 
 
   I simplified the MWE: 
https://gist.github.com/lostella/9a790fd89726c1741a1fcf4194a5dac6
   
   It seems like it's ultimately an LSTMCell problem.
   
   ```
   import mxnet as mx
   
   class MyBlock(mx.gluon.HybridBlock):
       def __init__(self):
           super().__init__()
           with self.name_scope():
               self.lstmcell = mx.gluon.rnn.LSTMCell(hidden_size=20)
   
       def hybrid_forward(self, F, seq):
           outputs, state = self.lstmcell.unroll(inputs=seq, length=10, 
layout="NTC", merge_outputs=True)
           return outputs
   
   block = MyBlock()
   block.initialize()
   block.hybridize()
   
   input = mx.nd.random_normal(shape=(32, 10, 5))
   output = block(input)
   
   block.export(path="./model", epoch=0)
   symbol = mx.gluon.SymbolBlock.imports(
       symbol_file="./model-symbol.json",
       input_names=[f"data"],
       param_file="./model-0000.params",
       ctx=mx.Context.default_ctx
   )
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to