You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/10/11 07:51:44 UTC

[GitHub] tornadomeet opened a new issue #8217: AttributeError using gluon HybridBlock

tornadomeet opened a new issue #8217: AttributeError using gluon HybridBlock 
URL: https://github.com/apache/incubator-mxnet/issues/8217
 
 
   ```python
   import mxnet as mx
   from mxnet import gluon
   from mxnet.gluon import nn
   
   class TestNet(gluon.HybridBlock):
       def __init__(self, **kwargs):
           super(TestNet, self).__init__(**kwargs)
           with self.name_scope:
               self.fc = nn.Dense(128)
   
       def hybrid_block(self, F, x):
           return self.fc(x)
   
   net = TestNet()
   ```
   
   error log:
   ```shell
   Traceback (most recent call last):
     File "test_hybridblock.py", line 14, in <module>
       net = TestNet()
     File "test_hybridblock.py", line 8, in __init__
       with self.name_scope:
   AttributeError: __exit__
   ```
   same error whith this tutorial: https://mxnet.incubator.apache.org/tutorials/gluon/hybrid.html#hybridblock  
   
   git rev-parse HEAD  
   ```7232b1292221adf3ed19169540f8813dcd63bb71```
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services