Function: set_model_dir
Applicable Products
- Ascend 950PR&950DT products: Not supported
- Atlas A3 products: Supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Supported
- Atlas training products: Supported
Function
Sets the directory for loading model files. The directory stores single-operator model files (*.om files).
Prototype
-
C Prototype
aclError aclopSetModelDir(const char *modelDir) -
Python Function
ret = acl.op.set_model_dir(model_dir)
Parameters
| Parameter | Description |
|---|---|
| model_dir | Str, directory where the specified model file is stored. A multi-level directory is supported. However, the system reads the model up to three levels down from the last level. For the example, if modelDir is set to dir0/dir1 and dir1 contains dir2/dir3/dir4, the system looks up for the model file in dir1, dir1/dir2 and dir1/dir2/dir3 only. |
Return Values
| Return Value | Description |
|---|---|
| ret | Int, error code: 0 on success; else, failure. |
Constraints
Before loading, check whether the memory space is sufficient based on the size of the single-operator OM file. If the memory space is insufficient, the application will be abnormal. The maximum number of operators being executed in a process varies depending on the product model.
- For Ascend 950PR&950DT, Atlas A3, and Atlas A2 products, the maximum number is 2,000,000.
- For Atlas 200I/500 A2 inference products and Atlas training products, the maximum number is 40,000,000.
- For Atlas inference products, the upper limit is 40,000,000 in Ascend EP form and 2,000,000 in open Ctrl CPU from.
Reference
For details about the API calling process and examples, see Single-Operator Calling.