Search code examples
deep-learninggluonscoring

How to load a GluonTS DeepAR model


I am new to GluonTS and deep learning in general. I have a GluonTS DeepAR model which has files like -

myPrefix-xxxx.params
myPrefix-network.json

What is the way to load this model for scoring? I tried below but this looks for prefix-symbol.json

import mxnet as mx
model = mx.mod.Module.load(myPrefix,epochs)

Thanks.


Solution

  • The way to load a GluonTS model is to use the Predictor class and deserialize it -

    from gluonts.model.predictor import Predictor
    from pathlib import Path
    
    model = Predictor.deserialize(Path(path_to_the_model))