This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-TDA4VM: edgeai-modelmaker 训练编译的模型在开发板上运行结果不正常

Part Number: SK-TDA4VM
Other Parts Discussed in Thread: TDA4VM

使用edgeai-modelmaker 运行./run_modelmaker.sh config_detection.yaml (使用的都是文件里的默认配置  网络模型用的是yolox_s_lite_mmdet)

训练并生成了模型

20221116-065632_yolox_s_lite_mmdet_onnxrt_tda4vm.tar.gz

执行文件夹里的extract.sh解压得到模型文件夹

20221116-065632_yolox_s_lite_mmdet_onnxrt_tda4vm

将这个模型文件夹放到开发板的/opt/model_zoo文件夹下,配置了object_detection.yaml

文件然后在apps_python文件夹下执行下面的操作

./app_edgeai.py ../configs/object_detection.yaml

报了很多条如下的警告:

2022-11-18 01:20:32.475599266 [W:onnxruntime:, graph.cc:1074 Graph] Initializer bbox_head.multi_level_conv_cls.0.weight appears in graph inputs and will not be treated as constant value/weight. This may prevent some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.

 

2022-11-18 01:20:32.475701641 [W:onnxruntime:, graph.cc:1074 Graph] Initializer bbox_head.multi_level_conv_cls.0.bias appears in graph inputs and will not be treated as constant value/weight. This may prevent some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the

 [W:onnxruntime:, graph.cc:1074 Graph] Initializer 1764 appears in graph inputs and will not be treated as constant value/weight. This may prevent some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.

 

然后出现下面的画面,跟正常推理的demo相比,没有显示total time和framerate,请问是哪里出问题了呢

  • 感谢您对TI产品的关注!为更加有效地解决您的问题,由于问题比较复杂,我需要询问更了解这款芯片的TI资深工程师,再为您解答,一旦得到回复会立即回复给您。

  • 问题解决了,同志们~

    问题一:警告的问题

    使用python remove_initializer_from_input.py --input ./model.onnx --output ./model_new.onnx指令可以将训练得到的模型进行处理   将处理好的onnx模型代替之前的模型,重新编译就可以消除警告了

    问题二:运行不正常的问题

    这里是遇上错误推理停止在这里了,仔细比对开发板上的例程,经过数次尝试发现是param.yaml文件配置的问题,这个param文件是编译时自动生成的,里面有些参数不太对,我训练的是十分类的,所以我这里定义修改如下:

    (1)num_classes自动生成的是90,我训练的是10分类的所以这里改为1

    (2)Metric label_offset_pred这里自动生成只有一个1,这里参考例子修改为

     

        0: 1

        1: 2

        2: 3

        3: 4

        4: 5

        5: 6

        6: 7

        7: 8

        8: 9

    9: 10

    (3)还有calibration_dataset和input_dataset下面的name,自动生成的名字为modelmaker,如果不改的话会报错,这里自定义一个self_classes,同时还要修改apps_python下面的

    classnames.py文件,仿照里面的定义增加一个self_classes的列表

    这样就能跑出正常结果了。