aclopSetModelDir

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

×

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function Usage

Sets the directory of the model file, which is an OM file compiled from a single-operator.

Prototype

1
aclError aclopSetModelDir(const char *modelDir)

Parameters

Parameter

Input/Output

Description

modelDir

Input

Pointer to the model file directory.

A multi-level directory is supported. However, the system reads the model up to three levels down from the last level.

For 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.

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

The operator package version in the model loading environment must match the version used in the model building environment. Otherwise, an error is reported during operator loading. You can check the operator library version by viewing the version field in the ${INSTALL_DIR}/opp/version.info file. Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.

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 the Ascend 950PR/Ascend 950DT, Atlas A3 training products/Atlas A3 inference products, and Atlas A2 training products/Atlas A2 inference products, the limit is 2,000,000.
  • For the Atlas 200I/500 A2 inference products and Atlas training products, the limit is 40,000,000.
  • For the Atlas inference products, the limit is 40,000,000 in Ascend EP form and is 2,000,000 in Open Ctrl CPU form.