导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    v853NPU gaitset模型部署失败

    V Series
    2
    2
    1197
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • C
      carpediem LV 4 最后由 编辑

      把训练好的gaitset.onnx转化为network_binary.nb模型后,在开发板上运行时,出现错误,如下图所示。

      root@TinaLinux:~# vpm_run sample.txt
      vpm_run sample.txt loop_run_count device_id
          sample.txt: to include one ore more network binary graph (NBG) data file resource.  See sample.txt for details.
      loop_run_count: the number of loop run network.
      device_id: specify this NBG runs device.
      example: ./vpm_run sample.txt 1 1, specify the NBG runs on device 1.
               ./vpm_run sample.txt 1000, run this network 1000 times.
      
      test started.
      
      init vip lite, driver version=0x00010800...
      [0xb6fbd560]vip_init[104],
      The version of Viplite is: 1.8.0-0-AW-2022-04-21
      vip lite init OK.
      
      cid=0xee, device_count=1
        device[0] core_count=1
      init test resources, batch_count: 1 ...
      create/prepare networks ...
      batch i=0, binary name: ./network_binary.nb
      input 0 dim 44 64 100 1, data_format=2, quant_format=2, name=input[0], scale=0.003922, zero_point=0
      ouput 0 dim 256 62 1 0, data_format=1, name=uid_1_out_0, none-quant
      nbg name=./network_binary.nb
      create network 1: 24090 us.
      memory pool size=11265280byte
      read golden file ./outputg.tensor
      input 0 name: ./input.tensor
      prepare network 0: 395732 us.
      batch: 0, loop count: 1
      start to run network=./network_binary.nb
      [0xb6fbd560]gcvip_os_call_kernel[344], fail to ioctl vipcore, command[4]:CMD_WAIT, status=-1
      [0xb6fbd560]gcvip_user_wait[484], failed to check status=-1
      [0xb6fbd560]gcvip_capture_init[1240], catpure file name .//viplite_hang_capture_617de3_460_b6fbd560.log
      

      后来观察转换过程中的模型结构,发现存在问题。
      a5d8adf3-e9dd-4be7-9bbc-03c7ae08fbc3-image.png
      上面这个是简化onnx模型后的gaitset-sim.onnx的结构图
      0347aadf-fc62-48f6-826e-b8c7102bcccd-image.png
      这个是导出nb模型之后保存的gaitset-simprj_fused.json的结构图。其中pooling之后的数据的结构为【44,32,0,32】,这个是不是有问题?
      请问大家有解决这个问题的办法吗?

      附上模型转换过程中的代码:

      python -m onnxsim gaitset.onnx gaitset-sim.onnx --input-shape 1,100,64,44
      
      pegasus import onnx --model gaitset-sim.onnx --output-data gaitset-sim.data --output-model gaitset-sim.json --outputs "feature"
      
      pegasus generate inputmeta --model gaitset-sim.json --input-meta-output gaitset-sim_inputmeta.yml
      
      pegasus generate postprocess-file --model gaitset-sim.json --postprocess-file-output gaitset-sim_postprocessmeta.yml
      
      pegasus quantize --model gaitset-sim.json --model-data gaitset-sim.data --batch-size 1 --device CPU --with-input-meta gaitset-sim_inputmeta.yml --rebuild-all --model-quantize gaitset-sim.quantize --quantizer asymmetric_affine --qtype uint8
      
      pegasus inference --model gaitset-sim.json --model-data gaitset-sim.data --batch-size 1 --dtype quantized --model-quantize gaitset-sim.quantize --device CPU --with-input-meta gaitset-sim_inputmeta.yml --postprocess-file gaitset-sim_postprocessmeta.yml
      
      pegasus export ovxlib --model gaitset-sim.json --model-data gaitset-sim.data --dtype quantized --model-quantize gaitset-sim.quantize --batch-size 1 --save-fused-graph --target-ide-project 'linux64' --with-input-meta gaitset-sim_inputmeta.yml --output-path ovxilb/gaitset-sim/gaitset-simprj --pack-nbg-unify --postprocess-file gaitset-sim_postprocessmeta.yml --optimize "VIP9000PICO_PID0XEE" --viv-sdk ${VIV_SDK}
      
      1 条回复 最后回复 回复 引用 分享 0
      • WhycanService
        WhycanService LV 8 最后由 编辑

        有问题,手动修改json模型结构试一下

        1 条回复 最后回复 回复 引用 分享 0
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策