TypeError: bases must be types

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:

  1. 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.

  2. 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

Guess you like

Origin blog.csdn.net/qq_46684028/article/details/133496741