Skip to content

Little enhancement to the plot_training_log.py.example -- non-blocking execution#6438

Open
onkarganjewar wants to merge 1 commit intoBVLC:masterfrom
onkarganjewar:fix-plot-training-blocking
Open

Little enhancement to the plot_training_log.py.example -- non-blocking execution#6438
onkarganjewar wants to merge 1 commit intoBVLC:masterfrom
onkarganjewar:fix-plot-training-blocking

Conversation

@onkarganjewar
Copy link

Background

  • Currently, in the caffe/tools/extra/plot_training_log.py.example there is a call to plt.show().
  • This is the last call that gets invoked in this script, and since it is made in a non-interactive mode; it blocks until the figures have been closed. Reference

In non-interactive mode, display all figures and block until the figures have been closed;

  • I tested this behaviour in my Mac OS X and plt.show() does not open up an image preview for the user to close unless the interactive mode is on with plt.pause().

What does this PR do?

  • I'm proposing two alternatives to fix this issue so it would work across different platforms:
    a. Add the (block=False) to override the blocking behavior. Or,
    b. Make the plot interactive using plt.ion() and add certain pause() for the user to react to the plot frame within a certain limit, so the script won't keep on running forever.

Why is it necessary?

I know that plot_training_log.py.example is supposed to be an example and customization is a must.

But, I still believe including/introducing this non-blocking execution approach to the end user would be beneficial and could save some time investigating this problem, especially on the OS X machines.

System configuration

Operating system: mac OS X Sierra 10.12.6
BLAS: open
Python version (if using pycaffe): Python 2.7.15 :: Anaconda, Inc.

Do not block the plot_training_log.py.example script so that it can run
to completion. If user chooses not to exit the plot preview window or
did not see the preview window at all, then the script might keep on
running instead of terminating in the end.
@onkarganjewar onkarganjewar changed the title Little enhancement to the plot_training_log.py.example -- unblocking execution Little enhancement to the plot_training_log.py.example -- non-blocking execution Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant