简体   繁体   English

Tensorboard:“localhost 拒绝连接”,Tensorboard 页面完全空白

[英]Tensorboard: “localhost refused to connect”, Tensorboard page completely blank

I can't get TensorBoard to show anything but a blank page (not even a header or anything) when loading "localhost:6006" in my Chrome in Windows.在 Windows 中的 Chrome 中加载“localhost:6006”时,我无法让 TensorBoard 显示除空白页之外的任何内容(甚至没有 header 或任何内容)。 The only thing indicating that tensorboard is indeed running on this port is the tab title.唯一表明 tensorboard 确实在此端口上运行的是选项卡标题。 I mostly followed the official tutorial from tensorflow, but implemented it in my own project: https://www.tensorflow.org/tensorboard/get_started我主要遵循tensorflow的官方教程,但在我自己的项目中实现了它: https://www.tensorflow.org/tensorboard/get_started

Inside the Jupyter Notebook I get a gray field saying: "localhost refused to connect" (it's in german on my computer, but it should translate somehow like this.) There are logs in the specified directory already, but I don't think that's even relevant to my problem.在 Jupyter Notebook 中,我得到一个灰色字段:“localhost 拒绝连接”(它在我的计算机上是德语,但它应该以某种方式翻译。)指定目录中已经有日志,但我不认为那是甚至与我的问题有关。 I have seen tons of quite similar questions out in the internet, but they all seemed to be somehow different and none of the solutions worked for me.我在互联网上看到了大量非常相似的问题,但它们似乎都有些不同,而且没有一个解决方案对我有用。

I tried writing 127.0.0.1 instead of localhost with no luck.我尝试写 127.0.0.1 而不是 localhost 没有运气。 I killed the "tensorboard.exe" process and deleted all the files in "...\temp.tensorboard-info", still nothing.我杀死了“tensorboard.exe”进程并删除了“...\temp.tensorboard-info”中的所有文件,仍然没有。 Restarted my machine, still no luck.重新启动我的机器,仍然没有运气。

I used the following lines of code concerning tensorboard:我使用了以下有关张量板的代码行:

%load_ext tensorboard
...
logdir = os.path.join("logs", datetime.now().strftime("%Y%m%d-%H%M%S"))
tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1)
...
model.fit(x_train, y_train, validation_data=(x_test,y_test), epochs=20, callbacks=[tensorboard_callback])

%tensorboard --logdir=./logs --host localhost

I never managed to see anything of the actual Tensorboard GUI.我从未设法看到任何实际的 Tensorboard GUI。 I see the "tensorboard.exe" process running in the task manager.我看到任务管理器中正在运行“tensorboard.exe”进程。

I managed to solve the problem by reinstalling my whole Anaconda/python environment.我设法通过重新安装我的整个 Anaconda/python 环境来解决这个问题。 The problem was probably caused by multiple installations of tensorflow or some damaged installation.该问题可能是由于多次安装 tensorflow 或某些损坏的安装引起的。 I hope this helps people with the similar problem.我希望这可以帮助有类似问题的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM