Package ai.djl.paddlepaddle.engine
Class PpModel
- java.lang.Object
-
- ai.djl.BaseModel
-
- ai.djl.paddlepaddle.engine.PpModel
-
- All Implemented Interfaces:
ai.djl.Model,java.lang.AutoCloseable
public class PpModel extends ai.djl.BaseModelPpModelis the PaddlePaddle implementation ofModel.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidload(java.nio.file.Path modelPath, java.lang.String prefix, java.util.Map<java.lang.String,?> options)Loads the PaddlePaddle model from a specified location.<I,O>
ai.djl.inference.Predictor<I,O>newPredictor(ai.djl.translate.Translator<I,O> translator, ai.djl.Device device)-
Methods inherited from class ai.djl.BaseModel
describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getArtifactNames, getBlock, getDataType, getModelPath, getName, getNDManager, getProperty, load, newTrainer, paramPathResolver, readParameters, save, setBlock, setDataType, setModelDir, setProperty, toString
-
-
-
-
Method Detail
-
load
public void load(java.nio.file.Path modelPath, java.lang.String prefix, java.util.Map<java.lang.String,?> options) throws java.io.IOExceptionLoads the PaddlePaddle model from a specified location.Map<String, String> options = new HashMap<>() options.put("epoch", "3"); model.load(modelPath, "squeezenet", options);- Parameters:
modelPath- the directory of the modelprefix- the model file name or path prefixoptions- load model options, see documentation for the specific engine- Throws:
java.io.IOException- Exception for file loading
-
newPredictor
public <I,O> ai.djl.inference.Predictor<I,O> newPredictor(ai.djl.translate.Translator<I,O> translator, ai.djl.Device device)- Specified by:
newPredictorin interfaceai.djl.Model- Overrides:
newPredictorin classai.djl.BaseModel
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceai.djl.Model- Overrides:
closein classai.djl.BaseModel
-
-