Skip to content

Troubleshooting TensorBoard integration in VS Code

Joyce Er edited this page Apr 8, 2021 · 2 revisions

There are several known issues that you may encounter when trying to use TensorBoard inside VS Code. If your scenario is not covered below, please file a bug.

Inline TensorBoard in a Jupyter notebook

If:

  1. You are using VS Code Jupyter notebooks via the Python and Jupyter extensions and
  2. You are using the TensorBoard nbextension to start TensorBoard inline in a Jupyter notebook and
  3. The cell output from running %tensorboard --logdir logs/fit is blank

This may be due to an incompatible version of TensorBoard being installed. The fix would be to install TensorBoard >=2.4.1 to get TensorBoard to load in VS Code Jupyter notebooks.

Integrated TensorBoard sessions

If:

  1. You are on Windows and
  2. You are launching TensorBoard using our Python: Launch TensorBoard command and
  3. The webview consistently comes up blank and
  4. When you open the developer console (Cmd/Ctrl + Shift + P to bring up the command palette, then execute Toggle Developer Tools), you see an error which says [Embedded Page] Refused to execute script from 'http://localhost:6006/index.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

This may be due to a MIME type misconfiguration and is also tracked as https://github.com/tensorflow/tensorboard/issues/3077. You can verify if this is your problem by running the following code in a shell:

python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"

If the output is anything other than application/javascript, the most common cause is that some other application has added an incorrect mimetype to the Windows registry as part of its installation process. The fix in this case would be to look for and delete the "Content Type" key with value "text/plain" under the Computer\HKEY_CLASSES_ROOT.js registry hive.

Clone this wiki locally