---
title: 函数：bundle_get_model_id
description: "获取实际可执行的模型ID。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclpythondevg_01_1098.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclpythondevg_01_1098.html
indexId: 5dc7854b9192e6d0a5a8bd034513abfabae2770374b9a8745140099cce80ba0475
---
# 函数：bundle_get_model_id

#### 功能说明

获取实际可执行的模型ID。

本接口需与以下其它接口配合使用，以便实现动态更新变量的目的，请参见acl.mdl.bundle_load_from_file处的说明。


#### 函数原型

- C函数原型
  1 aclError aclmdlBundleGetModelId(uint32_t bundleId, size_t index, uint32_t *modelId)

- python函数
  1 model_id, ret = acl.mdl.bundle_get_model_id(bundle_id, index)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| bundle\_id | int，通过acl.mdl.bundle\_load\_from\_file接口或acl.mdl.bundle\_load\_from\_mem接口加载模型成功后返回的bundle\_id。 |
| index | int，索引。用户调用acl.mdl.bundle\_get\_model\_num接口获取模型数量后，这个index的取值范围：[0, (模型数量\-1)]。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| model\_id | int，实际可执行的模型ID。 |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 资源参考

接口调用流程及示例代码请参见权重更新(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0099.html)。
