|
|
@@ -134,7 +134,9 @@ class Model(nn.Module): |
|
|
|
for _ in range(10): |
|
|
|
_ = m(x) |
|
|
|
dt.append((time_synchronized() - t) * 100) |
|
|
|
logger.info('%10.1f%10.0f%10.1fms %-40s' % (o, m.np, dt[-1], m.type)) |
|
|
|
if m == self.model[0]: |
|
|
|
logger.info(f"{'time (ms)':>10s} {'GFLOPS':>10s} {'params':>10s} {'module'}") |
|
|
|
logger.info(f'{dt[-1]:10.2f} {o:10.2f} {m.np:10.0f} {m.type}') |
|
|
|
|
|
|
|
x = m(x) # run |
|
|
|
y.append(x if m.i in self.save else None) # save output |
|
|
@@ -157,7 +159,8 @@ class Model(nn.Module): |
|
|
|
m = self.model[-1] # Detect() module |
|
|
|
for mi in m.m: # from |
|
|
|
b = mi.bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85) |
|
|
|
logger.info(('%6g Conv2d.bias:' + '%10.3g' * 6) % (mi.weight.shape[1], *b[:5].mean(1).tolist(), b[5:].mean())) |
|
|
|
logger.info( |
|
|
|
('%6g Conv2d.bias:' + '%10.3g' * 6) % (mi.weight.shape[1], *b[:5].mean(1).tolist(), b[5:].mean())) |
|
|
|
|
|
|
|
# def _print_weights(self): |
|
|
|
# for m in self.model.modules(): |