Skip to content

Commit

Permalink
Update program.py (#13989)
Browse files Browse the repository at this point in the history
avoid ZeroDivisionError when training.
  • Loading branch information
lona-cn authored Oct 13, 2024
1 parent 9668890 commit ea7ba39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,11 @@ def eval(

pbar.close()
model.train()
metric["fps"] = total_frame / total_time
# Avoid ZeroDivisionError
if total_time > 0:
metric["fps"] = total_frame / total_time
else:
metric["fps"] = 0 # or set to a fallback value
return metric


Expand Down

0 comments on commit ea7ba39

Please sign in to comment.