meituan / YOLOv6

YOLOv6: a single-stage object detection framework dedicated to industrial applications.
GNU General Public License v3.0
5.72k stars 1.03k forks source link

AttributeError: 'RepVGGBlock' object has no attribute 'conv' #528

Open wanyne-yyds opened 2 years ago

wanyne-yyds commented 2 years ago

Before Asking

Search before asking

Question

使用 partial_quant.py 量化部分代码报错如下:

Skip Layer detect.proj_conv
op amax =  6.2489, amax = -1.0000
op amax =  6.2489, amax =  6.2489
amax =  6.2489
Traceback (most recent call last):
  File "./tools/partial_quantization/partial_quant.py", line 92, in <module>
    ops = [get_module(model_ptq, op_name) for op_name in sub_fusion_list]
  File "./tools/partial_quantization/partial_quant.py", line 92, in <listcomp>
    ops = [get_module(model_ptq, op_name) for op_name in sub_fusion_list]
  File "/home/ckn/Code/YOLOv6/tools/partial_quantization/utils.py", line 18, in get_module
    cur_mod = getattr(cur_mod, s)
  File "/home/ckn/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1178, in __getattr__
    type(self).__name__, name))
AttributeError: 'RepVGGBlock' object has no attribute 'conv'

Additional

No response

lippman1125 commented 2 years ago

@wanyne-yyds which model do you use? v6s_reopt or v6s?

lippman1125 commented 2 years ago

@wanyne-yyds ops' name in op_concat_fusion_list are from v6s_reopt, if you use v6s to apply partial ptq, you need to modify ops'name in op_concat_fusion_list.

semihhdemirel commented 2 years ago

@wanyne-yyds I used v6s_repopt. But I still encounter the same error. Can you explain more detail, what should i do for this error? What exactly should be written in the op_concat_fusion_list.

BouchikhiYousra commented 1 year ago

I have the exact same issue but I'm using v6n_repopt