GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow TensorBoard to load in VS Code despite existing MIME type misco… · analiabs/vscode-python@c983c03

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • news/2 Fixes
    • 16072.md
  • pythonFiles
    • tensorboard_launcher.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎news/2 Fixes/16072.md‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Workaround existing MIME type misconfiguration on Windows preventing TensorBoard from loading when starting TensorBoard.
Collapse file

‎pythonFiles/tensorboard_launcher.py‎

Copy file name to clipboardExpand all lines: pythonFiles/tensorboard_launcher.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
import time
22
import sys
33
import os
4-
from tensorboard import default
4+
import mimetypes
55
from tensorboard import program
66

77

88
def main(logdir):
9+
# Environment variable for PyTorch profiler TensorBoard plugin
10+
# to detect when it's running inside VS Code
911
os.environ["VSCODE_TENSORBOARD_LAUNCH"] = "1"
12+
13+
# Work around incorrectly configured MIME types on Windows
14+
mimetypes.add_type("application/javascript", ".js")
15+
16+
# Start TensorBoard using their Python API
1017
tb = program.TensorBoard()
1118
tb.configure(bind_all=False, logdir=logdir)
1219
url = tb.launch()
1320
sys.stdout.write("TensorBoard started at %s\n" % (url))
1421
sys.stdout.flush()
22+
1523
while True:
1624
try:
1725
time.sleep(60)

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.