Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Incompatible with tensorflow-tensorboard #342

Closed
luheng opened this issue Sep 20, 2017 · 9 comments
Closed

Incompatible with tensorflow-tensorboard #342

luheng opened this issue Sep 20, 2017 · 9 comments
Assignees
Projects

Comments

@luheng
Copy link

luheng commented Sep 20, 2017

There might be something I'm missing, but it seems that the import:
from tensorboard import SummaryWriter
would break if I install tensorflow-tensorboard or tensorflow, which is required if I want to launch a tensorboard. My current workaround is to launch a tensorboard outside the virtual environment.

@DeNeutoy
Copy link
Contributor

Yes, that's a good point - I also just run tensorboard outside of the virtual environment, but I agree this isn't ideal. We were trying to avoid including tensorflow as a dependency and tensorboard wasn't a separate entity from tensorflow at that point - this would be a good upgrade now it's a separate pip package.

@laubonghaudoi
Copy link

laubonghaudoi commented Oct 19, 2017

I encountered the same issue, when I run from allennlp.models.encoder_decoders.simple_seq2seq import SimpleSeq2Seq, it breaks as below. I think changing from tensorboard import to from tensorboardX import would help, as tensorboardX is made for pytorch.

In [1]: from allennlp.models.encoder_decoders.simple_seq2seq import SimpleSeq2Seq
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-002fdbacde9d> in <module>()
----> 1 from allennlp.models import simple_seq2seq

~/anaconda3/lib/python3.6/site-packages/allennlp-0.2.1-py3.6.egg/allennlp/models/__init__.py in <module>()
      5 
      6 from allennlp.models.archival import archive_model, load_archive
----> 7 from allennlp.models.decomposable_attention import DecomposableAttention
      8 from allennlp.models.encoder_decoders.simple_seq2seq import SimpleSeq2Seq
      9 from allennlp.models.model import Model

~/anaconda3/lib/python3.6/site-packages/allennlp-0.2.1-py3.6.egg/allennlp/models/decomposable_attention.py in <module>()
     11 from allennlp.nn import InitializerApplicator, RegularizerApplicator
     12 from allennlp.nn.util import get_text_field_mask, last_dim_softmax, weighted_sum
---> 13 from allennlp.training.metrics import CategoricalAccuracy
     14 
     15 

~/anaconda3/lib/python3.6/site-packages/allennlp-0.2.1-py3.6.egg/allennlp/training/__init__.py in <module>()
----> 1 from allennlp.training.trainer import Trainer

~/anaconda3/lib/python3.6/site-packages/allennlp-0.2.1-py3.6.egg/allennlp/training/trainer.py in <module>()
     19 from torch.optim.lr_scheduler import _LRScheduler as PytorchLRScheduler  # pylint: disable=protected-access
     20 import tqdm
---> 21 from tensorboard import SummaryWriter
     22 
     23 from allennlp.common import Params

ImportError: cannot import name 'SummaryWriter'

@schmmd
Copy link
Member

schmmd commented Nov 27, 2017

Confirmed this is still an issue.

$ pip install tensorflow-tensorboard
$ python -c 'from tensorboard import SummaryWriter'                                                                                                                                                                                                                     (allennlp) 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'SummaryWriter'

Also confirmed that the following doesn't fail.

python -c 'from tensorboardX import SummaryWriter'

@DeNeutoy are you able to try using tensorboard using tensorboardX and let us know if it still provides you what you need?

@isalirezag
Copy link

I have this problem as well

@zhanghaoie
Copy link

I have this problem as well.

@nelson-liu
Copy link
Contributor

Can you provide more detail with a traceback / open a new issue? Thanks

@Prav2018
Copy link

File "C:\Anaconda3\envs\allennlp\lib\site-packages\allennlp\common\util.py", line 11, in
import resource
ModuleNotFoundError: No module named 'resource'

for import:
from allennlp.predictors.bidaf import Predictor

@nelson-liu
Copy link
Contributor

@Prav2018 : it looks like you're using windows, which allennlp does not yet support (see #612)

@Prav2018
Copy link

Prav2018 commented Jul 25, 2018

@nelson-liu are there any alternate approaches to this problem ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Team Board
  
Awaiting triage
Development

No branches or pull requests

8 participants