Closed chowkamlee81 closed 6 years ago
Gluon model zoo has it in master branch now, which you can use to generate the json and param
mx.gluon.model_zoo.vision.mobilenet1_0(pretrained=True).export('mobilenet1_0')
Hi szha, model has been downloaded . But while exporting to .json and .param files throws an error ""Please first call block.hybridize() and then run forward with " "this block at least once before calling export."
Kindly help to resolve the issue as it thrown an exception in mxnet/gluon/block.py below code
def export(self, path, epoch=0):
"""Export HybridBlock to json format that can be loaded by `mxnet.mod.Module`
or the C++ interface.
.. note:: When there are only one input, it will have name `data`. When there
Are more than one inputs, they will be named as `data0`, `data1`, etc.
Parameters
----------
path : str
Path to save model. Two files `path-symbol.json` and `path-xxxx.params`
will be created, where xxxx is the 4 digits epoch number.
epoch : int
Epoch number of saved model.
"""
if not self._cached_graph:
raise RuntimeError(
"Please first call block.hybridize() and then run forward with "
"this block at least once before calling export.")
@szha , model has been downloaded . But while exporting to .json and .param files throws an error ""Please first call block.hybridize() and then run forward with " "this block at least once before calling export."
Kindly help to resolve the issue as it thrown an exception in mxnet/gluon/block.py below code
def export(self, path, epoch=0):
"""Export HybridBlock to json format that can be loaded by mxnet.mod.Module
or the C++ interface.
.. note:: When there are only one input, it will have name `data`. When there
Are more than one inputs, they will be named as `data0`, `data1`, etc.
Parameters
----------
path : str
Path to save model. Two files `path-symbol.json` and `path-xxxx.params`
will be created, where xxxx is the 4 digits epoch number.
epoch : int
Epoch number of saved model.
"""
if not self._cached_graph:
raise RuntimeError(
"Please first call block.hybridize() and then run forward with "
"this block at least once before calling export.")
Sorry, my bad.
net = mx.gluon.model_zoo.vision.mobilenet1_0(pretrained=True)
net.hybridize()
net(mx.nd.ones((1,3,224,224)))
net.export('mobilenet1_0')
Got the one. Thanks its working... Closing the issue...
Recently i found MobileNet gluon version of model.param.
I would like to have symbolic version of mobileNet in model.param and also .json format file. Is anything are avilable in modelzoo with json and mobilenet.param file. Kindly reply... @szha do you any updates on this....