Problem description: ImportError: TensorBoard logging requires TensorBoard with Python summary writer installed. (or from torch.utils.tensorboard import SummaryWriter line reports an error)
Solution: Generally, the tensorboard package is not installed, and the SummaryWriter module cannot be found in torch.utils.tensorboard.
So just install the tensorboardX package with pip
pip install tensorboardX
After the tensorboardX package is installed, the above error is still reported, so modify the original import code
Convert the original:
from torch.utils.tensorboard import SummaryWriter
change into:
from tensorboardX import SummaryWriter
Reference: [1] https://blog.csdn.net/qq_28666313/article/details/106343611