auto_decomposition

产品支持情况

产品

是否支持

Atlas A2 训练系列产品/Atlas 800I A2 推理产品/A200I A2 Box 异构组件

x

Atlas 200I/500 A2 推理产品

Atlas 推理系列产品

Atlas 训练系列产品

功能说明

根据用户提供的Caffe原始模型(.prototxt和.caffemodel),生成张量分解后的模型文件以及权重文件。

函数原型

1
auto_decomposition(model_file,weights_file,new_model_file,new_weights_file)

参数说明

参数名

输入/输出

说明

model_file

输入

含义:用户Caffe模型的定义文件,格式为.prototxt。

数据类型:string

weights_file

输入

含义:用户训练好的Caffe模型权重文件,格式为.caffemodel。

数据类型:string

new_model_file

输入

含义:张量分解后的Caffe模型定义文件,格式为.prototxt,例如xx_tensor_decomposition.prototxt。

数据类型:string

new_weights_file

输入

含义:张量分解后的Caffe模型权重文件,格式为.caffemodel,例如xx_tensor_decomposition.caffemodel。

数据类型:string

返回值说明

约束说明

调用示例

1
2
3
4
5
from amct_caffe.tensor_decompose import auto_decomposition
auto_decomposition(model_file='ResNet-50-deploy.prototxt',
                  weights_file='ResNet-50-weights.caffemodel',
                  new_model_file='ResNet-50-deploy_tensor_decomposition.prototxt',
                  new_weights_file='ResNet-50-deploy_tensor_decomposition.caffemodel')

落盘文件说明: