本文介绍了Tensorboard 显示一个空白页面(拒绝从 'http://localhost:6006/index.js' 执行脚本,因为它的 MIME 类型)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试打开 tesnorflow 时,我得到了一个木板页面:

When Trying to open tesnorflow I just get a plank page:

这是在Firefox中的样子:

This is how it looks like in firefox:

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

I get the error message in the chrome console:

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.

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

In the firefox console I get the error message:

The resource from "http://localhost:6006/index.js" was blocked due to MIME type ("text/plain") mismatch (X-Content-Type-Options: nosniff)

Loading failed for the <script> with source "http://localhost:6006/index.js".

我试过了:
无法在浏览器中打开 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

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

I have tensorboard version: 2.1.0I generated my data like that:

 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()

我遵循了本教程:TensorBoard with PyTorch - 可视化深度学习指标

推荐答案

There's a similar error and resolutionreported 此处.

There's a similar error and resolution reported here.

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

Apparently this has to do with some issue in the windows registry. Based on the comments this seems to be the solution

就我而言,以下过程解决了问题:

  1. windows + r 和 regedit
  2. [您的计算机]\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js
  3. 将内容类型从text/plain"更改为application/javascript"

这篇关于Tensorboard 显示一个空白页面(拒绝从 'http://localhost:6006/index.js' 执行脚本,因为它的 MIME 类型)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 22:20