---
title: 函数：unload
description: "| C函数原型 | aclError aclmdlUnload(uint32\\_t modelId) |"
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0136.html"
---

# 函数：unload

| C函数原型 | aclError aclmdlUnload(uint32\_t modelId) |
| --- | --- |
| Python函数 | ret = acl.mdl.unload(model\_id) |
| 函数功能 | 系统完成模型推理后，可调用该接口卸载模型，释放资源，同步接口。 |
| 输入说明 | model\_id：int，指定需卸载的模型的ID。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 在调用acl.mdl.unload接口卸载指定模型时，需确保其它接口没有正在使用该模型。 模型加载、模型执行、模型卸载的操作必须在同一个Context下（关于Context的创建请参见acl.rt.create\_context）。 |
| 参考资源 | 接口调用流程，参见pyACL接口调用流程。 |
