Skip to content

Commit

Permalink
Merge branch 'zuoym15-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpa committed Oct 20, 2019
2 parents 8dcac01 + 377b5f9 commit c9ecc54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tensorboardX/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,12 @@ def make_video(tensor, fps):
clip = mpy.ImageSequenceClip(list(tensor), fps=fps)

filename = tempfile.NamedTemporaryFile(suffix='.gif', delete=False).name
try: # older version of moviepy does not support progress_bar argument.
clip.write_gif(filename, verbose=False, progress_bar=False)

# moviepy >= 1.0.0 use logger=None to suppress output.
try:
clip.write_gif(filename, verbose=False, logger=None)
except TypeError:
logging.warning('Upgrade to moviepy >= 1.0.0 to supress the progress bar.')
clip.write_gif(filename, verbose=False)

with open(filename, 'rb') as f:
Expand Down

0 comments on commit c9ecc54

Please sign in to comment.