Unverified Commit d69d985a authored by Tan SU's avatar Tan SU Committed by GitHub
Browse files

[Fix] Fix ProfilerHook when using IterBasedRunner (#1755)

parent 466a6c82
......@@ -142,7 +142,7 @@ class ProfilerHook(Hook):
raise ValueError('on_trace_ready should be handler, dict or None, '
f'but got {type(self.on_trace_ready)}')
if runner.max_epochs > 1:
if self.by_epoch and runner.max_epochs > 1:
warnings.warn(f'profiler will profile {runner.max_epochs} epochs '
'instead of 1 epoch. Since profiler will slow down '
'the training, it is recommended to train 1 epoch '
......
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