Skip to content

在将cn_clip.pt文件转为.onnx文件时,cn_clip时可以将文本侧输出和图像侧输出导出到同一个onnx文件中吗? #393

@huangyanxin-China

Description

@huangyanxin-China

torch.onnx.export(
model,
(image, text), # 输入:图像 + tokenized 文本
text_fp32_onnx_path, # 输出 ONNX 文件
input_names=["image", "text"], # 输入节点名称
output_names=["image_features", "text_features"], # 输出节点名称
export_params=True, # 导出模型参数
opset_version=13, # ONNX opset 版本
verbose=True, # 打印详细信息
dynamic_axes={
"image": {0: "batch"}, # 动态 batch size(可选)
"text": {0: "batch"}, # 动态 batch size(可选)
},
)这样的写法是正确的吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions