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

Viewed 17253

I'm coding in Python on a Jupyter Notebook (Python 3) on Windows, and I've installed PyTorch and 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?

Here's how I'm importing torch.utils.tensorboard

from torch.utils.tensorboard import SummaryWriter
3 Answers

Use pip install tensorboard or pip3 install tensorboard OR pip 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. usually you need pytorch with GPU version to achieve tensorboard import in torch.utils

Related