Skip to content

Commit 606d30d

Browse files
committed
Update error msg in engines
1 parent 97251b5 commit 606d30d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ptflops/aten_engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def get_flops_aten(model, input_res,
103103
Union[int, None]]:
104104

105105
params_sum = get_model_parameters_number(model)
106+
model.eval()
106107
output_params = {'serialize_params':
107108
{'units': flops_units, 'precision': output_precision},
108109
'print_params': {'file': ost}}
@@ -128,7 +129,7 @@ def get_flops_aten(model, input_res,
128129

129130
except Exception as e:
130131
print("Flops estimation was not finished successfully because of"
131-
f"the following exception:\n{type(e)} : {e}")
132+
f" the following exception:\n{type(e)} : {e}")
132133
traceback.print_exc()
133134

134135
return None, None

ptflops/pytorch_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def reset_environment():
6868

6969
except Exception as e:
7070
print("Flops estimation was not finished successfully because of"
71-
f"the following exception:\n{type(e)} : {e}")
71+
f" the following exception:\n{type(e)} : {e}")
7272
traceback.print_exc()
7373
reset_environment()
7474

0 commit comments

Comments
 (0)