visual-studio-codetensorboard

How to run tensorboard in vscode?


Whenever I try to run tensorboard in a jupyter notebook within visual studio code with this command tensorbard --logdir=runs, I get the message Launching TensorBoard.... However, Tensorboard never launches. Sometimes I also get an error message.

Any ideas on how to launch tensorboard within vscode?

EDIT:

I also tried running slightly optimized commands

%load_ext tensorboard
%tensorboard --logdir runs

but this only shows the message Launching Tensorboard... eternally.

Same result with

%reload_ext tensorboard
%tensorboard --logdir runs --host localhost --port 8888

Is there any tensorboard extension that embeds tensorboard into a cell output?


Solution

  • VS Code and the Python extension now has TensorBoard integrated in it in its latest release!

    https://devblogs.microsoft.com/python/python-in-visual-studio-code-february-2021-release/

    To start a TensorBoard session from VSC:

    1. Open the command palette (Ctrl/Cmd + Shift + P)
    2. Search for the command “Python: Launch TensorBoard” and press enter.
    3. You will be able to select the folder where your TensorBoard log files are located. By default, the current working directory will be used.

    VSCode will then open a new tab with TensorBoard and its lifecycle will be managed by VS Code as well. This means that to kill the TensorBoard process all you have to do is close the TensorBoard tab.