Tensorboard 显示一个空白页面(拒绝执行来自 'http://localhost:6006/index.js' 的脚本,因为它的 MIME 类型)

Lup*_*pos 2 python-3.x tensorflow tensorboard pytorch

尝试打开 tesnorflow 时,我只看到一个木板页面: 在此处输入图片说明

这是它在 Firefox 中的样子:

在此处输入图片说明

我在 chrome 控制台中收到错误消息:

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.
Run Code Online (Sandbox Code Playgroud)

在 Firefox 控制台中,我收到错误消息:

The resource from “http://localhost:6006/index.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff)
Run Code Online (Sandbox Code Playgroud)

Loading failed for the <script> with source “http://localhost:6006/index.js”.
Run Code Online (Sandbox Code Playgroud)

我试过:
无法在浏览器中打开 Tensorboard
Tensorboard 得到空白页

我在控制台输入:

tensorboard --logdir=runs --bind_all
tensorboard --logdir=./runs --bind_all
tensorboard --logdir=./runs/ --bind_all
tensorboard --logdir=./runs --host localhost --port 6006  
tensorboard --logdir=./runs --host localhost 
tensorboard --logdir=./runs --port 6006 --bind_all
Run Code Online (Sandbox Code Playgroud)

我有张量板版本:2.1.0 我像这样生成了我的数据:

 train_set = torchvision.datasets.FashionMNIST(
        root="./data/FashionMNIST",
        train=True,
        download=True,
        transform=transforms.Compose([
            transforms.ToTensor()
        ])
    )
train_loader = torch.utils.data.DataLoader(train_set, batch_size=1000)
tb = SummaryWriter()

network = Network()
images, labels = next(iter(train_loader))
grid = torchvision.utils.make_grid(images)

tb.add_image("image", grid)
tb.add_graph(network, images)
tb.close()
Run Code Online (Sandbox Code Playgroud)

我遵循了本教程:TensorBoard with PyTorch - Visualize Deep Learning Metrics

jod*_*dag 6

有一个类似的错误并解决报告在这里

显然,这与 Windows 注册表中的某些问题有关。根据评论,这似乎是解决方案

在我的情况下,以下过程解决了问题:

  1. windows + r 和 regedit
  2. [你的电脑]\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js
  3. 将内容类型从“text/plain”更改为“application/javascript”