fabrahman / Emo-Aware-Storytelling

Code repository for our EMNLP 2020 long paper "Modeling Protagonist Emotions for Emotion-Aware Storytelling" (https://arxiv.org/abs/2010.06822)
MIT License
19 stars 6 forks source link

No module named 'texar.data' #2

Open swidi opened 3 years ago

swidi commented 3 years ago

There seems to be an issue with the included texar module.

I installed it as described in the README via pip install -e . but it cannot be imported:

>>> import texar
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marcel/PycharmProjects/poemo-generation/third_party/texar/texar/__init__.py", line 32, in <module>
    from texar import models
  File "/home/marcel/PycharmProjects/poemo-generation/third_party/texar/texar/models/__init__.py", line 25, in <module>
    from texar.models.seq2seq import *
  File "/home/marcel/PycharmProjects/poemo-generation/third_party/texar/texar/models/seq2seq/__init__.py", line 24, in <module>
    from texar.models.seq2seq.seq2seq_base import *
  File "/home/marcel/PycharmProjects/poemo-generation/third_party/texar/texar/models/seq2seq/seq2seq_base.py", line 26, in <module>
    from texar.data.data.paired_text_data import PairedTextData
ModuleNotFoundError: No module named 'texar.data'

This leads to run_emosup.py failing

swidi commented 3 years ago

When I use the prepackaged Texar module from pip instead (same version - 0.2.1), 'texar.data' is found, but I get this error instead:

AttributeError: module 'texar.utils' has no attribute 'reduce_with_weights'

which makes sense because you seem to be using an adapted version of texar.

xinli2008 commented 3 years ago

Same error! when i want to run " sh run_interactive.sh" to interactively generate emotion-aware stories: I install the texar 0.2.1 ,and i enter python environment to test if it is successfully installed. the error is :>>> import texar Traceback (most recent call last): File "", line 1, in File "/home/lixin/Emo-Aware-Storytelling-master/third_party/texar/texar/init.py", line 26, in from texar.module_base import File "/home/lixin/Emo-Aware-Storytelling-master/third_party/texar/texar/module_base.py", line 26, in from texar.utils.exceptions import TexarError File "/home/lixin/Emo-Aware-Storytelling-master/third_party/texar/texar/utils/init.py", line 31, in from texar.utils.utils_io import File "/home/lixin/Emo-Aware-Storytelling-master/third_party/texar/texar/utils/utils_io.py", line 32, in from tensorflow import gfile ImportError: cannot import name 'gfile'

My error is same with you ,I really want to reproduce this project,becaues it is so excellent. Can you give me some useful advice ? I am so sorrt to bother you! And my tensorflow version is 1.12.0,tensorflow-probability version is 0.7 @swidi @fabrahman

swidi commented 3 years ago

Try and check my forked repo: https://github.com/swidi/poemo-generation

I believe I had some import trouble as well. Check my README and req.txt for dependencies, that's all I can help you with as I don't have much memory about this project anymore.

xinli2008 commented 3 years ago

Thank you for you timely reply! I hope i can solve the question ~ wish you have nice day! sincerely