You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/05/29 22:31:19 UTC
[GitHub] ThomasDelteil opened a new issue #11091: Symbolic .json file not
compatible with .params file generated since MXNet 1.2
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:
users@infra.apache.org
With regards,
Apache Git Services