Commit 9c1c356c authored by Sam Tsai's avatar Sam Tsai Committed by Facebook GitHub Bot
Browse files

not block if assertion error when counting flops

Summary:
fvcore flops calculator throws on this error:

KeyError: 'Only support flattening dictionaries if keys are str.'

Setting flops to some value so it doesn't enter pdb mode.

Reviewed By: stephenyan1231

Differential Revision: D32144492

fbshipit-source-id: 604cd4660cea9ffbfb3f1da35d32e06ccf607a50
parent afbd4558
......@@ -87,6 +87,7 @@ def dump_flops_info(model, inputs, output_dir, use_eval_mode=True):
"Failed to estimate flops using detectron2's FlopCountAnalysis. "
f"Error written to {output_file}."
)
flops = float("nan")
return flops
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment