×
分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

修改输入尺寸后yolov3 离线模型生成问题 lxjin2002021-09-14 15:45:53 回复 3 查看 使用求助
修改输入尺寸后yolov3 离线模型生成问题
分享到:

以下是在官方提供的pytorch docker镜像里面运行的结果。

我们使用的数据集中图片宽高比比较极端,达到了16:1,使用yolov3默认的输入形状检测效果很差。

为了提升性能,我们修改了模型定义的输入的尺寸为64*1024,并且相应地修改了模型定义/torch/venv3/pytorch/lib/python3.5/site-packages/torchvision/models/ _detection/yolov3/models.py里面yolo 的nG和grid_x,grid_y等变量,以及yolov3.cfg中的输入尺寸,并成功生成了量化模型,但是在调用genoff生成离线模型的时候却出现了报错,请问应该如何修改?

(pytorch) root@black2070:/torch/src/catch/examples/offline/genoff# python genoff.py -model yolov3 -mname mm2camv1_int16_1024_bs1 -mcore MLU220 -core_number 4 -batch_size 1 -half_input 0

CNML: 7.9.2 1a1e33b

CNRT: 4.9.1 4cd7a8a

2021-09-14 07:29:22.840473: [cnrtWarning] [20023] [Card : NONE] Failed to initialize CNDEV. Host manage interface disabled 

2021-09-14 07:29:22.842650: [cnrtError] [20023] [Card : NONE] No MLU can be found !

2021-09-14 07:29:22.842661: [cnrtError] [20023] [Card : NONE] Error occurred in cnrtInit during calling driver interface.

2021-09-14 07:29:22.842664: [cnrtError] [20023] [Card : NONE] Return value is 5, MLU_ERROR_NO_DEVICE, means that No useful mlu device

2021-09-14 07:29:22.842692: [cnmlError] No MLU device

2021-09-14 07:29:22.842862: [cnmlError] No MLU device

[genoff.py line:223] - INFO: Generate offline model: yolov3

/torch/venv3/pytorch/lib/python3.5/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.

  warnings.warn(warning.format(ret))

nG is  13

nG is  26

nG is  52

2021-09-14 07:29:23.814873: [cnrtError] [20023] [Card : NONE] input param  is invalid device handle in cnrtSetCurrentDevice

2021-09-14 07:29:31.975565: [cnmlError] MLU::conv Op should follow these rules: input_c == filter_c, now, input_c=3, filter_c=4op_id:4

2021-09-14 07:29:31.976542: [cnmlError] MLU::conv Op dimension mismatch

Traceback (most recent call last):

  File "genoff.py", line 225, in <module>

    in_height, in_width, half_input, input_format, fake_device)

  File "genoff.py", line 187, in genoff

    net_traced(example_mlu.to(ct.mlu_device()))

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torch/nn/modules/module.py", line 541, in __call__

    result = self.forward(*input, **kwargs)

RuntimeError: CNML error: CNML_STATUS_INVALIDPARAM

The above operation failed in interpreter, with the following stack trace:


版权所有 © 2021 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭