python-3.x - Tensorboard 显示空白页(拒绝执行来自“http://localhost:6006/index.js”的脚本,因为它的 MIME 类型)
问题描述
这是它在 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.
在 Firefox 控制台中,我收到错误消息:
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 我生成了这样的数据:
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 - Visualize Deep Learning Metrics
解决方案
这里报告了类似的错误和解决方案。
显然这与 Windows 注册表中的一些问题有关。根据评论,这似乎是解决方案
在我的情况下,以下程序解决了问题:
- windows + r 和注册表编辑器
- [你的电脑]\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js
- 将内容类型从“text/plain”更改为“application/javascript”
推荐阅读
- discord.py - 鉴于没有发生禁止因素,有没有办法在经过一定时间后执行操作?discord.py 重写
- plot - 如何在 seaborn 图中添加孟加拉语字体?
- string - 正确获取中文字符串的宽度
- python - QtableView Frozen column
- javascript - array always empty after came out from ajax call
- python - usage of sqlalchemy in aws lambda is failing on this error: errorMessage: the greenlet library is required to use this function
- pine-script - Is there a table.cell_merge() function?
- docker - Restrict connections to the Docker host for several subnets
- twitter-bootstrap - Customizing Bootstrap using default Bootstrap variables
- swift - Swift: NSMutableAttributedString generated from PDF. Can it be parsed into a Dictionary?