---
title: 函数：bundle_unload
description: "系统完成模型推理后，可调用该接口卸载通过acl.mdl.bundle_load_from_file接口或acl.mdl.bundle_load_from_mem接口加载的模型，释放资源。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclpythondevg_01_1100.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclpythondevg_01_1100.html
indexId: dafd4db9c42a0114ebc4d1e0be50e02b7ea36fbdd8e2779b875a481b6c3d8b0b75
---
# 函数：bundle_unload

#### 功能说明

系统完成模型推理后，可调用该接口卸载通过acl.mdl.bundle_load_from_file接口或acl.mdl.bundle_load_from_mem接口加载的模型，释放资源。

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


#### 函数原型

- C函数原型
  1 aclError aclmdlBundleUnload(uint32_t bundleId)

- python函数
  1 ret = acl.mdl.bundle_unload(bundle_id)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| bundle\_id | int，通过acl.mdl.bundle\_load\_from\_file接口或acl.mdl.bundle\_load\_from\_mem接口加载模型成功后返回的bundle\_id。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 资源参考

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