Function: set_model_dir

C Prototype

aclError aclopSetModelDir(const char *modelDir)

Python Function

ret = acl.op.set_model_dir(model_dir)

Function Usage

Sets the directory to store the model file, which is an *.om file built from a single operator.

Input 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 Value

ret: int, error code.

Restrictions

Before loading the model file, check whether the memory space is sufficient based on the file size. If the memory space is insufficient, the application will be abnormal.

For the Atlas 200/300/500 Inference Product, when your app runs on the host, a single process can execute up to 40,000,000 operators at a time.when your app runs on the device, a single process can execute up to 2,000,000 operators at a time.

For the Atlas Training Series Product, when your app runs on the host, a single process can execute up to 40,000,000 operators at a time.

Reference

For details about the API call sequence and example, see Single-Operator Calling.