Error: TypeError: bases must be types
Cause: When importing torch.utils.tensorboard.SummaryWriter
. Because the TensorBoard or protobuf library version is incompatible with the PyTorch version.
solve:
-
Make sure you use a version of PyTorch that is compatible with other dependent libraries. Check the version requirements for PyTorch, TensorBoard, and protobuf and ensure compatibility exists between them.
-
Update or downgrade related library versions. Try updating PyTorch, TensorBoard, and protobuf to the latest version, or try downgrading to a known compatible version.
pip install protobuf==3.20.1