From e7fc27406ab32b9860c9b351b30ca1c47f543433 Mon Sep 17 00:00:00 2001 From: Yuantao Yang <31794133+orangeccc@users.noreply.github.com> Date: Wed, 11 Aug 2021 23:38:34 +0800 Subject: [PATCH] Fix module count in parse_model (#4379) Co-authored-by: yangyuantao --- models/yolo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/yolo.py b/models/yolo.py index 380f3401e..98e578d20 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -234,7 +234,7 @@ def parse_model(d, ch): # model_dict, input_channels(3) except: pass - n = max(round(n * gd), 1) if n > 1 else n # depth gain + n = n_ = max(round(n * gd), 1) if n > 1 else n # depth gain if m in [Conv, GhostConv, Bottleneck, GhostBottleneck, SPP, DWConv, MixConv2d, Focus, CrossConv, BottleneckCSP, C3, C3TR, C3SPP]: c1, c2 = ch[f], args[0] @@ -264,7 +264,7 @@ def parse_model(d, ch): # model_dict, input_channels(3) t = str(m)[8:-2].replace('__main__.', '') # module type np = sum([x.numel() for x in m_.parameters()]) # number params m_.i, m_.f, m_.type, m_.np = i, f, t, np # attach index, 'from' index, type, number params - LOGGER.info('%3s%18s%3s%10.0f %-40s%-30s' % (i, f, n, np, t, args)) # print + LOGGER.info('%3s%18s%3s%10.0f %-40s%-30s' % (i, f, n_, np, t, args)) # print save.extend(x % i for x in ([f] if isinstance(f, int) else f) if x != -1) # append to savelist layers.append(m_) if i == 0: