简体   繁体   English

Python PyTorch 错误:ModuleNotFoundError:没有名为“torch.utils.tensorboard”的模块

[英]Python PyTorch Error: ModuleNotFoundError: No module named 'torch.utils.tensorboard'

I'm coding in Python on a Jupyter Notebook (Python 3) on Windows, and I've installed PyTorch and TensorBoard.我在 Windows 上的 Jupyter Notebook (Python 3) 上的 Python 中进行编码,并且我已经安装了 PyTorch 和 TensorBoard。 My problem is that i'm getting this error message:我的问题是我收到此错误消息:

ModuleNotFoundError: No module named 'torch.utils.tensorboard'

I've already tried to use pip install future but the error remains, how can I fix this?我已经尝试使用pip install future但错误仍然存在,我该如何解决这个问题?

Here's how I'm importing torch.utils.tensorboard这是我导入torch.utils.tensorboard的方式

from torch.utils.tensorboard import SummaryWriter

Use pip install tensorboard or pip3 install tensorboard OR pip install --upgrade tensorboard && pip install --upgrade torch使用pip install tensorboard or pip3 install tensorboardpip install --upgrade tensorboard && pip install --upgrade torch

You need to reinstall with the torch version below:您需要使用以下火炬版本重新安装:

pip3 install torch==1.4.0

Guess you are running on a machine w/o GPU device.猜猜你在没有 GPU 设备的机器上运行。 usually you need pytorch with GPU version to achieve tensorboard import in torch.utils通常你需要 pytorch 和 GPU 版本来实现torch.utils中的tensorboard导入

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

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