How to solve ImportError: cannot import name 'SummaryWriter' from partially initialized module 'torch.utils.tensorboard' (most likely due to a circular import) ?

Ask Questions Forum: ask Machine Learning Questions to our readersCategory: PyTorchHow to solve ImportError: cannot import name 'SummaryWriter' from partially initialized module 'torch.utils.tensorboard' (most likely due to a circular import) ?
Chris Staff asked 3 weeks ago
1 Answers
Best Answer
Chris Staff answered 3 weeks ago

You either have named the script you are running tensorboard.py or have a tensorboard.py somewhere in your directory which interferes with actual TensorBoard – indeed, a circular import.

Rename the file into e.g. tb.py and things will be fixed.

Your Answer

4 + 10 =