Function: load_from_file
|
C Prototype |
aclError aclmdlLoadFromFile(const char *modelPath, uint32_t *modelId) |
|---|---|
|
Python Function |
model_id, ret = acl.mdl.load_from_file(model_path) |
|
Function Usage |
Loads an offline model (offline model adapted to Ascend AI Processor) from a file. The memory is managed by the system. Returns the model ID after the model is loaded. The model ID is used for model identification in subsequent operations. |
|
Input Description |
model_path: str, path for storing the offline model file. The file name is contained in the path. The user who runs the app must have the permission to access the directory. The offline model file is an offline model (.om file) adapted to the Ascend AI Processor.
NOTE:
|
|
Return Value |
model_id: int, pointer address of the model ID generated after the system loads the model. ret: int, error code.
|
|
Restrictions |
|
|
API |
pyACL also provides the acl.mdl.set_config_opt and acl.mdl.load_with_config APIs for model loading. The caller needs to set the attributes in the configuration object passed to the API call to decide how the model will be loaded and who will manage the memory. |
|
Reference |
For details about the API call sequence, see Loading a Model. |