Conflict when using Tensorboard with matplotlib

Hi everyone, My work runs on Window. I used anaconda to create an environment. I also install Pyqt5. But when I want to use Tensorboard to visualize the training process, I got errors:

  • if I use matplotlib to show any image result, I got an error:
Cannot mix incompatible Qt library (5.9.7) with this library (5.15.0)
  • If I only use tensorboard, no problem occur.
  • If I uninstall tensorboard, I can show my image results.

Could anyone help me to solve it?
Thank you

Based on the error message I guess you might have some library conflicts with PyQt, i.e. matplotlib seems to need another version than the installed one.
You could try to update matplotlib (and hope it can use the newer PyQt version) or switch to another backend in matplotlib.

Thank you for your reply.
I have tried to update matplotlib, but it cannot solve the problem: when I add:

from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter(‘./runs/Classification’)
writer.add_scalar(“Loss/Train”,loss,epoch)

and using matplotlib to display any graph, it will get error:

Cannot mix incompatible Qt library (5.9.7) with this library (5.15.0)

I want to try uninstall Qt library 5.9.7, but I don’t know what command line can help me to do that (with pip or conda)?

pip/conda uninstall ... should work and you would have to use the package manager, which was used to install it in the first place.