glenn-jocher
commited on
Commit
•
4890499
1
Parent(s):
6c1290f
Improved yolo.py profiling (#2940)
Browse files* Improved yolo.py profiling
Improved column order and labelling.
* Update yolo.py
- models/yolo.py +5 -2
models/yolo.py
CHANGED
@@ -134,7 +134,9 @@ class Model(nn.Module):
|
|
134 |
for _ in range(10):
|
135 |
_ = m(x)
|
136 |
dt.append((time_synchronized() - t) * 100)
|
137 |
-
|
|
|
|
|
138 |
|
139 |
x = m(x) # run
|
140 |
y.append(x if m.i in self.save else None) # save output
|
@@ -157,7 +159,8 @@ class Model(nn.Module):
|
|
157 |
m = self.model[-1] # Detect() module
|
158 |
for mi in m.m: # from
|
159 |
b = mi.bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85)
|
160 |
-
logger.info(
|
|
|
161 |
|
162 |
# def _print_weights(self):
|
163 |
# for m in self.model.modules():
|
|
|
134 |
for _ in range(10):
|
135 |
_ = m(x)
|
136 |
dt.append((time_synchronized() - t) * 100)
|
137 |
+
if m == self.model[0]:
|
138 |
+
logger.info(f"{'time (ms)':>10s} {'GFLOPS':>10s} {'params':>10s} {'module'}")
|
139 |
+
logger.info(f'{dt[-1]:10.2f} {o:10.2f} {m.np:10.0f} {m.type}')
|
140 |
|
141 |
x = m(x) # run
|
142 |
y.append(x if m.i in self.save else None) # save output
|
|
|
159 |
m = self.model[-1] # Detect() module
|
160 |
for mi in m.m: # from
|
161 |
b = mi.bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85)
|
162 |
+
logger.info(
|
163 |
+
('%6g Conv2d.bias:' + '%10.3g' * 6) % (mi.weight.shape[1], *b[:5].mean(1).tolist(), b[5:].mean()))
|
164 |
|
165 |
# def _print_weights(self):
|
166 |
# for m in self.model.modules():
|