Toybrick

onnx 转 rknn Fatal: Meet unsupported operator : SVMClassifier(name="...

ImmanuelLee

注册会员

积分
52
发表于 2024-2-27 15:49:32    查看: 925|回复: 0 | [复制链接]    打印 | 显示全部楼层
问题背景:
使用sklearn库,用python语言,实现“带有rbf核函数的SVM算法”;
将SVM算法的 ".pkl" 存储格式,转换为 ".onnx" 格式,即onnx模型。

问题:
在将 onnx模型转换为rknn模型过程中报错,内容如下:
I base_optimize ...
I base_optimize done.
I
I fold_constant ...
I fold_constant done.
I
I correct_ops ...
I correct_ops done.
I
I fuse_ops ...
I fuse_ops done.
I
I sparse_weight ...
I sparse_weight done.
I
I rknn building ...
I RKNN: [23:39:46.073] compress = 0, conv_eltwise_activation_fuse = 1, global_fuse = 1, multi-core-model-mode = 7, output_optimize = 1,enable_argb_group=0 ,layout_match = 0, pipeline_fuse = 0
I RKNN: librknnc version: 1.6.0 (585b3edcf@2023-12-11T07:42:56)
D RKNN: [23:39:46.076] RKNN is invoked
Fatal: Meet unsupported operator: SVMClassifier(name="SVMc").

Process finished with exit code 1


onnx转换rknn的代码如下:
from rknn.api import RKNN

if __name__ == '__main__':
    rknn = RKNN(verbose = True, verbose_file ="log.txt")
    # rknn = RKNN()

    rknn.config(
        mean_values=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],
        std_values=[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]],
        quantized_dtype="asymmetric_quantized-8",
        quantized_algorithm='normal',
        quantized_method='channel',
        quant_img_RGB2BGR=False,
        target_platform='rk3588',
        float_dtype="float16",
        optimization_level=3,
        custom_string="this is my rknn model",
        remove_weight=False,
        compress_weight=False,
        inputs_yuv_fmt=None,
        single_core_mode=False,

    )
    rknn.load_onnx(
       model="./SVM_rbf_ONNXmodel_Lee20240227.onnx",
       # model="/home/topeet/rknn/01_export_rknn/model_CNN_py38_rk110_Lee20230914.pt",
       input_size_list=[[1,24]],
    )
    rknn.build(
        do_quantization=False,
        # rknn_batch_size=-1,
    )
    rknn.export_rknn(
        export_path="SVM_rknn1.6_Lee20240227.rknn"
    )

    rknn.release()



求助~!~!

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表