【debug】General bug centralized repair: (most likely due to a circular import)

What do you want to write in this article

Problem Description:

  • ImportError: cannot import name ‘SummaryWriter’ from partially initialized module ‘torch.utils.tensorboard’ (most likely due to a circular import) (E:\ProgramData\Anaconda3\envs\pytorch38\lib\site-packages\torch\utils\tensorboard_init_.py)
  • ImportError: cannot import name 'SummaryWriter' from partially initialized module 'torch.utils.tensorboard' (most likely due to circular imports) (E:ProgramDataAnaconda3envspytorch38libsite-packagestorchutilstensorboard__init__.py)

    insert image description here

Cause Analysis:

  • The error means that I call a package in a loop;
  • The reason is that I made a mistake in the file name and made it the same name as the python subpackage;

Solution:

  • Just change the file name.

Reference link:

Method for reference, encountered the same problem

Guess you like

Origin blog.csdn.net/weixin_42306148/article/details/127779329