safrooze commented on issue #12795: Deserialization problem with gluon 
`ValueError: There are multiple outputs with name ...`
URL: 
https://github.com/apache/incubator-mxnet/issues/12795#issuecomment-429151434
 
 
   @lostella while the issue is being root caused,  one work around in this 
case would be to use different blocks with shared parameters:
   
   ```
   class MyBlock(mx.gluon.HybridBlock):
       def __init__(self):
           super().__init__()
           with self.name_scope():
               self.model0 = mx.gluon.nn.Dense(units=5)
               self.model1 = mx.gluon.nn.Dense(units=5, 
params=self.model0.collect_params())
   
       def hybrid_forward(self, F, x, y):
           return self.model0(x) + self.model1(y)
   ```

----------------------------------------------------------------
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