How to load gluon model from model trained with symbol API?

The following code:

model = mx.gluon.SymbolBlock(outputs=net_symbol, inputs=mx.sym.Variable("data"))
    arg_params, ctx=context, cast_dtype=True, dtype_source="saved", allow_missing=True
    aux_params, ctx=context, cast_dtype=True, dtype_source="saved", allow_missing=True

Is causing this error when trying to predict:

RuntimeError: Parameter 'softmax_label' has not been initialized. Note that you should initialize parameters and create Trainer with Block.collect_params() instead of Block.params because the later does not include Parameters of nested child Blocks

And SymbolBlock.imports fails due to softmax_label as well.

Any ideas ?

try this code.

ctx = mx.gpu()

net = gluon.nn.SymbolBlock.imports("abcd.json",['data'], "abcd.params")


I found out that the issue is when moving between gluon and symbol the softmaxoutput layer.
Gluon adds it on the fly when training while symbol keeps it.