Tensorboardx: ImportError: cannot import name 'SummaryWriter'

Created on 23 Aug 2017  路  4Comments  路  Source: lanpa/tensorboardX

I do not use anaconda, I install tensorboard-pytorch and tensorflow py pip in the virtual enviroment.

I tried, from tensorboard import SummaryWriter, it complains as the title. However, I find the SummaryWriter is in the writer.py in tensorboard, so I have to use from tensorboard.writer import SummaryWriter. Where am I wrong?

Most helpful comment

I think it's the same case as mentioned in #17, and
pip install tensorboardX should solve the problem.

All 4 comments

I think it's the same case as mentioned in #17, and
pip install tensorboardX should solve the problem.

You are right.

from tensorboard import summary as summary_lib
from tensorboard.plugins.custom_scalar import layout_pb2

When I was running the following command, an error occurred. I'm sorry to bother you, but please help me anyway

(n2n) [410@mu01 noise2noise-master]$ python config.py validate --dataset-dir=datasets/kodak --network-snapshot=results/network_final-gaussian-n2c.pickle
Traceback (most recent call last):
File "config.py", line 14, in
import validation
File "/home/410/ysn/noise2noise-master/validation.py", line 16, in
import dnnlib.tflib.tfutil as tfutil
File "/home/410/ysn/noise2noise-master/dnnlib/tflib/__init__.py", line 8, in
from . import autosummary
File "/home/410/ysn/noise2noise-master/dnnlib/tflib/autosummary.py", line 28, in
from tensorboard import summary as summary_lib
ImportError: cannot import name 'summary'

@YangSN0719 It should be from tensorboardX, not tensorboard.

Was this page helpful?
0 / 5 - 0 ratings