Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 814
MJimitater Avatar asked Sep 17 '20 12:09

MJimitater


People also ask

Is PyCharm better than Vscode?

If you want something mature, specific, and well-configured for Python, then PyCharm is the way to go. However, if you prefer something lightweight that provides the freedom to customize, then VS Code is preferable. Both are great tools that can serve different purposes, depending on how you choose to use them.

Where is command palette in VS code?

Command Palette# VS Code is equally accessible from the keyboard. The most important key combination to know is Ctrl+Shift+P, which brings up the Command Palette. From here, you have access to all of the functionality of VS Code, including keyboard shortcuts for the most common operations.


2 Answers

You can use this

tensorboard --logdir=data/ --host localhost --port 8888
like image 157
Elona Shatri Avatar answered Oct 16 '22 09:10

Elona Shatri


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.

like image 32
Jeffrey Avatar answered Oct 16 '22 09:10

Jeffrey