Pytroch tutorials : From torch.utils.tensorboard import SummaryWriter

ImportError: cannot import name ‘SummaryWriter’ from ‘torch.utils.tensorboard’ (D:\dev\python\Anaconda3\envs\pytroch\lib\site-packages\torch\utils\tensorboard_init_.py)


it’s my environment:

  1. python 3.7 ,
  2. pytroch 1.6
  3. tensorboard 2.2.1

Here are the versions that work for me:

torch : 1.6.0
tensorboard : 2.2.1 or 2.3
python : 3.6.9
1 Like

I sitll have some questions , :sleepy:

Go ahead. If it’s at my level.

Thank you very much, I have solved the problem now, although I don’t know the specific reason. I copy my code to other folder, and change num_workers which in testloader =torch.utils.data.DataLoader(testset, batch_size=4, shuffle=False, num_workers=0) .I don’t even know what happened,it’s work. :smile: