mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Change matplotlib backend to 'agg' when 'show_plot' is false. This allows the script to be run from command line without any errors (for ex, on a remote machine)
This commit is contained in:
@ -10,8 +10,8 @@ import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
|
||||
|
||||
|
||||
@ -98,6 +98,8 @@ def log_parser(args):
|
||||
plt.savefig(save_path, dpi=300)
|
||||
if args.show_plot:
|
||||
plt.show()
|
||||
else:
|
||||
plt.switch_backend('agg')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user