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"))
model.collect_params().load_dict(
    arg_params, ctx=context, cast_dtype=True, dtype_source="saved", allow_missing=True
)
model.collect_params().load_dict(
    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")

net.collect_params().reset_ctx(ctx)

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.