Skip to content

Commit 037823e

Browse files
ppwwyyxxfacebook-github-bot
authored andcommitted
fix lint and update d2's use of flop
Summary: Facebook Reviewed By: rbgirshick Differential Revision: D20065531 fbshipit-source-id: c96b204376b326fb067b1e89b9aa4fbd1581eb3d
1 parent 316469d commit 037823e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

detectron2/utils/analysis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def forward(self, image):
6969

7070
old_train = model.training
7171
with torch.no_grad():
72-
ret, _ = flop_count(WrapModel(model).train(False), (tensor_input,), **kwargs)
72+
ret = flop_count(WrapModel(model).train(False), (tensor_input,), **kwargs)
73+
# compatible with change in fvcore
74+
if isinstance(ret, tuple):
75+
ret = ret[0]
7376
model.train(old_train)
7477
return ret

0 commit comments

Comments
 (0)