任何人都可以帮我解决此错误,我正在尝试使用allennlp模型并获得以下错误。
from allennlp.training.metrics import Average, BooleanAccuracy,
CategoricalAccuracy
File "/home/administrator/aman/venv-kbs/lib/python3.6/site-
packages/allennlp/training/__init__.py", line 3, in <module>
from allennlp.training.trainer import Trainer
File "/home/administrator/aman/venv-kbs/lib/python3.6/site-
packages/allennlp/training/trainer.py", line 21, in <module>
from tensorboard import SummaryWriter
ImportError: cannot import name 'SummaryWriter'
请在下面找到随版本一起安装的软件包。
tensorboard 1.0.0a6
tensorboard-pytorch 0.7.1
tensorboardX 0.8
tensorflow 1.4.0
tensorflow-tensorboard 0.4.0
答案 0 :(得分:1)
将from tensorboard import SummaryWriter
更改为from tensorboardX import SummaryWriter