ThomasDelteil opened a new issue #11091: Symbolic .json file not compatible 
with .params file generated since MXNet 1.2
URL: https://github.com/apache/incubator-mxnet/issues/11091
 
 
   `MXNet 1.2.0`
   
   Reproducible here:
   
   ```
   import mxnet as mx
   from mxnet import gluon
   net = gluon.nn.HybridSequential()
   with net.name_scope():
       net.add(gluon.nn.Conv2D(10, (3, 3)))
       net.add(gluon.nn.Dense(50))
   net.initialize()
   net(mx.nd.ones((1,1,50,50)))
   a = net(mx.sym.var('data'))
   a.save('test.json')
   net.save_params('test.params')
   model = gluon.nn.SymbolBlock(outputs=mx.sym.load_json(open('test.json', 
'r').read()),
                                    inputs=mx.sym.var('data'))
   model.load_params('test.params', ctx=ctx)
   ```
   
   Gives the following error:
   ```
   AssertionError: Parameter 'conv0_weight' is missing in file 'test.params', 
which contains parameters: '0.weight', '0.bias', '1.weight', '1.bias'. Set 
allow_missing=True to ignore missing parameters.
   ```
   
   This way to export symbol is recommended in [this tutorial on the straight 
dope](https://gluon.mxnet.io/chapter07_distributed-learning/hybridize.html)
   
   

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