Skip to content

Commit 2637e24

Browse files
authored
fix the bug of get_model_summary
When running this function, the mode of the model should be 'eval'.
1 parent 59c9a78 commit 2637e24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/utils/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def hook(module, input, output):
150150
and module != model:
151151
hooks.append(module.register_forward_hook(hook))
152152

153+
model.eval()
153154
model.apply(add_hooks)
154155

155156
space_len = item_length

0 commit comments

Comments
 (0)