tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

On Windows 10, after starting TensorBoard, pressing Ctrl+C to quit as shown on the screen does not work

Open MicrocontrollersAndMore opened this issue 8 years ago • 3 comments

I posted this on Stack Overflow a few weeks ago, and did not get any responses:

https://stackoverflow.com/questions/47856093/tensorflow-how-to-stop-tensorboard-from-command-line-in-windows

but the more I think it through, this seems to be a bug. I'll replicate the desctiption here in case the above link ever breaks, and for convenience:

If I put the following at the end of a TensorFlow Python program:

# show the result in TensorBoard
tfFileWriter = tf.summary.FileWriter(os.getcwd())
tfFileWriter.add_graph(sess.graph)
tfFileWriter.close()

I get a file in the same directory that is titled something like:

events.out.tfevents.1513529946.DESKTOP-KR0HCRR

Then I open a command prompt and enter:

tensorboard --logdir C:\Users\cdahms\Documents\TensorFlowExample9

I get the output from the command line:

TensorBoard 0.1.8 at http://DESKTOP-KR0HCRR:6006 (Press <kbd>CTRL</kbd>+<kbd>C</kbd> to quit)

If I open a broswer and go to http://localhost:6006 I get the expected TensorBoard graph.

Problem is, if I press CTRL+C the process from the command line does not quit as the TensorBoard output indicates. Here is a screenshot if that would be helpful:

untitled

I gather the CTRL+C must be for Linux and/or Mac but does not work in Windows. I've also tried X, Ctrl+X, Ctrl+Z, Esc, Crtl+Esc, Ctrl+D, and pretty much every other combination of keystroke to stop a process that I've ever known of.

To clarify I'm using Windows 10 and PyCharm as an editor (I'm not using a Jupyter Notebook). I'm using Python 3.6.x and Chrome as my browser if that matters.

Also, before somebody responds "just close that command line window and that will end TensorBoard, then open another command line window and enter the command again" yes, of course I understand I can do that, however it would be preferable to be able to stop TensorBoard from the command line and then re-start it after changing a script without having to close/re-open a new command line window.

If anybody could address this concern us Windows users would appreciate it, thanks.

MicrocontrollersAndMore avatar Jan 06 '18 19:01 MicrocontrollersAndMore

Hm, is this problem specific to TensorBoard on your machine? For example, if you run something in the console like python -c "import time; time.sleep(100)" can you CTRL-C and kill it successfully? (It should exit with KeyboardInterrupt.)

CTRL-C should in general work in the windows console: https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals https://stackoverflow.com/questions/800521/linuxlike-ctrl-c-keyboardinterrupt-for-the-windows-cmd-line

nfelt avatar Jan 08 '18 19:01 nfelt

Did somebody change something from TensorBoard 0.1.8 (in the screenshot above) and 0.4.0rc3? I'm using 0.4.0rc3 now and it seems to work. If I use Ctrl+C sometimes I have to press this combo twice, if I use Crtl+Pause/Break it stops immediately every time. Strange, I guess this bug can be closed.

CDahmsTemp avatar Jan 09 '18 00:01 CDahmsTemp

It's possible something changed in this behavior, though I'd be hard-pressed to say what exactly - as far as I know TensorBoard itself wouldn't do anything in particular to intercept Ctrl+C.

In general (including on non-Windows platforms) it's not unheard of to need to hit Ctrl+C more than once to quit a process, especially if it's busy with I/O or something similar. If you have the issue again where repeated Ctrl+C fails to kill TensorBoard (but it works fine for the time.sleep(100) example code), feel free to reopen and we can take another look.

nfelt avatar Jan 09 '18 00:01 nfelt