Loading Sagemaker NTM Artifacts #16230
Replies: 3 comments 1 reply
-
@salmanmashayekh is there any code piece available to reproduce? |
Beta Was this translation helpful? Give feedback.
-
Thank you both @lanking520 and @ThomasDelteil! Here is a MWE:
The training log is as follows:
When the training is done, it generates the following zip file, which includes a I am trying to load the Can you share the code snippet to create an mxnet model with the artifacts and predict on the |
Beta Was this translation helpful? Give feedback.
-
Hey @salmanmashayekh did you ever get this working? Using your code: sym, arg_params, aux_params = mx.model.load_checkpoint('model_algo-1', 0)
module_model = mx.mod.Module(symbol=sym, label_names=None, context=mx.cpu())
module_model.bind(
for_training = False,
data_shapes = [('data', (1, VOCAB_SIZE))]
) Runs fine for me, the next step for inference I assume is to set: module_model.set_params(arg_params=arg_params, aux_params=aux_params) But this throws an error, which requests epochs, but I am not sure why this is needed for prediction...
Small update: setting module_model.set_params(arg_params=arg_params, aux_params=aux_params, allow_missing=True) But calling predict, gives an odd output! module_model.predict(x) OUTPUT:
|
Beta Was this translation helpful? Give feedback.
-
I have trained a Neural Topic Model with Sagemaker and now I am trying to load/deploy the model locally. The artifacts include a
symbol
and an aparameters
file.I am using the following to load the model:
But when I try to
bind
the model:It fails with the following error:
From the model architecture (https://arxiv.org/pdf/1809.02687.pdf), I know that the input data shape is a vector with
VOCAB_SIZE
length.Any ideas what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions