解决问题 TensorBoard logging requires TensorBoard with Python summary writer installed.

问题描述:ImportError:TensorBoard logging requires TensorBoard with Python summary writer installed. (或者 from torch.utils.tensorboard import SummaryWriter 行报错)

解决方法:一般是tensorboard包未安装,在torch.utils.tensorboard中找不到SummaryWriter模块。
所以只要pip 安装一下tensorboardX包即可

pip install tensorboardX 

安装完成 tensorboardX 包后运行仍然报上面错误,那么修改原来的import代码

将原来的:

from torch.utils.tensorboard import SummaryWriter

修改为:

from tensorboardX import SummaryWriter

参考:[1] https://blog.csdn.net/qq_28666313/article/details/106343611

你可能感兴趣的:(python,pytorch)