Skip to content

Commit

Permalink
Enhance load_json_logs of analyze_logs.py (open-mmlab#7732)
Browse files Browse the repository at this point in the history
* Enhance load_json_logs of analyze_logs.py

* [Fix] flake8 check in analyze_logs.py

Co-authored-by: Wenwei Zhang <[email protected]>
  • Loading branch information
2 people authored and SakiRinn committed Mar 17, 2023
1 parent 9b8765c commit 697fab2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/analysis_tools/analyze_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ def load_json_logs(json_logs):
log_dicts = [dict() for _ in json_logs]
for json_log, log_dict in zip(json_logs, log_dicts):
with open(json_log, 'r') as log_file:
for line in log_file:
for i, line in enumerate(log_file):
log = json.loads(line.strip())
# skip the first training info line
if i == 0:
continue
# skip lines without `epoch` field
if 'epoch' not in log:
continue
Expand Down

0 comments on commit 697fab2

Please sign in to comment.