报错:module ‘google.protobuf.internal.containers‘ has no attribute ‘MutableMapping‘

报错位置
from torch.utils.tensorboard import SummaryWriter

分析
tensorboard包依赖于protobuf包,查看当前protobuf包版本:1.19.3

解决方案
安装旧版本pip install protobuf==1.10.0,运行查看pip show protobuf

Name: protobuf
Version: 3.10.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: None
Author-email: None
License: 3-Clause BSD License
Location: d:\programdata\anaconda3\lib\site-packages
Requires: six, setuptools
Required-by: tensorboard

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