Skip to content

Commit 2374a75

Browse files
yixu.cuiyixu.cui
authored andcommitted
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
1 parent 456bc55 commit 2374a75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

models/yolo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ def forward_once(self, x, profile=False):
341341
m(x.copy() if c else x)
342342
dt.append((time_synchronized() - t) * 100)
343343
print('%10.1f%10.0f%10.1fms %-40s' % (o, m.np, dt[-1], m.type))
344+
# [cui] Ref1.0: https://github.com/WongKinYiu/yolov7/issues/647#issuecomment-1238006745
345+
# [cui] Ref1.1: https://github.com/WongKinYiu/yolov7/issues/520#issuecomment-1223438537
346+
# [cui] Ref2: https://github.com/WongKinYiu/yolov7/issues/647#issuecomment-1423777996
347+
if isinstance(m, nn.Upsample):
348+
# if check_version(torch.__version__, '1.10.0'):
349+
m.recompute_scale_factor = False
344350

345351
x = m(x) # run
346352

0 commit comments

Comments
 (0)