vscode Tensorboard(通过Python Extension)在WSL2中不运行

发布于 2025-01-25 22:13:44 字数 787 浏览 5 评论 0原文

当我在WSL2内使用VSCODE并运行Python:启动张量命令时,它首先询问

包装张板需要启动张板会话。您想安装它吗?

来源:Python(扩展)

当我单击时,它说

无法安装张量。如果不可用,请使用您选择的软件包管理器手动将此库手动安装到您的Python环境中。

但是那是什么环境?我可以毫无问题地运行我的Python脚本和笔记本。我通常将Minconda用作环境经理,但我怀疑这与此有关。

运行张板-logdir =。 - 主机主机-PORT 8888在控制台中工作正常,但这有点不便。

这是VSCODE版本:

Version: 1.66.2 (user setup)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19043

附录

我现在意识到,如果我在常规的Python文件中,一切都可以。它只是在IPYNB笔记本中无法使用。这似乎是一个较小的错误 - 如果未指定其他Python环境,则Python扩展程序应使用笔记本电脑环境。还是有理由不这样做?

When I work with VSCode inside WSL2 and run the Python: Launch Tensorboard command, it first asks

The package TensorBoard is required to launch a TensorBoard session. Would you like to install it?

Source: Python (Extension)

When I click Yes, it says

Could not install tensorboard. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.

But what environment is that? I can run my python scripts and notebooks without problem. I typically use Miniconda as environment manager, but I doubt this has anything to do with it.

Running tensorboard --logdir=. --host localhost --port 8888 in the console works fine, but it is a bit inconvenient.

Here is the VSCode version:

Version: 1.66.2 (user setup)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19043

Addendum

I now realize that everything works if I am in a regular Python file. It just doesn't work in a ipynb notebook. This seems like a minor bug - the Python extension should use the notebook's environment if no other Python environment was specified. Or is there a reason not to?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风筝在阴天搁浅。 2025-02-01 22:13:44

您是否尝试使用:%tensorboard - bind_all - logdir?

当WSL在子网(桥接)上运行时,您可能需要在所有IP上收听。

这解决了我身边的问题:-)

Have you tried to start tensorboard with : %tensorboard --bind_all --logdir ?

As WSL runs on a subnet (bridge), you may need to listen on all IPs .

This solved the problem on my side :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文