sattree/gap

No module named 'models.model_pipelines'

Closed this issue · 4 comments

i'm trying to run the project, and got the error below.
Can you help me, please?

python run.py --preprocess_train --model=grep --language_model=bert-large-uncased --coref_models=url,allen,hug,lee --exp_dir=results\grep

Traceback (most recent call last):
  File "run.py", line 14, in <module>
    from models.model_pipelines import Model
ModuleNotFoundError: No module named 'models.model_pipelines'

The list below is my pip list

Package Version


-rotobuf 3.6.1
aadict 0.2.3
absl-py 0.9.0
alabaster 0.7.12
allennlp 0.9.0
asn1crypto 1.3.0
asposebarcode 1.0.0
asposestorage 1.0.2
asset 0.6.13
astor 0.7.1
atomicwrites 1.4.0
attrdict 2.0.1
attrs 19.3.0
Babel 2.8.0
backcall 0.1.0
bayesian-optimization 1.1.0
bleach 3.1.4
blis 0.2.4
boto3 1.12.46
botocore 1.15.46
catalogue 1.0.0
certifi 2020.4.5.1
cffi 1.14.0
chardet 3.0.4
Click 7.0
cloudpickle 0.6.1
cmake 3.12.0
colorama 0.4.3
conllu 1.3.1
cryptography 2.8
cycler 0.10.0
cymem 2.0.2
dask 0.20.2
dataclasses 0.7
de-core-news-sm 2.2.5
decorator 4.3.0
defusedxml 0.6.0
dlib 19.16.0
docutils 0.15.2
editdistance 0.5.3
en-core-web-sm 2.2.5
entrypoints 0.3
face-recognition 1.2.3
face-recognition-models 0.3.0
ffmpy 0.2.2
filelock 3.0.12
flaky 3.6.1
Flask 1.1.2
Flask-Cors 3.0.8
ftfy 5.7
gevent 20.6.0
globre 0.1.5
greenlet 0.4.16
grpcio 1.16.1
h5py 2.8.0
idna 2.9
imagesize 1.2.0
importlib-metadata 1.5.0
ipykernel 5.1.4
ipython 7.13.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
itsdangerous 1.1.0
jedi 0.16.0
Jinja2 2.11.1
jmespath 0.9.5
joblib 0.15.1
jsonpickle 1.4.1
jsonschema 3.2.0
jupyter-client 6.1.2
jupyter-core 4.6.3
Keras 2.3.1
Keras-Applications 1.0.6
kiwisolver 1.0.1
logzero 1.5.0
Markdown 3.0.1
MarkupSafe 1.1.1
matplotlib 3.2.1
mistune 0.8.4
mkl-fft 1.0.15
mkl-random 1.1.0
mkl-service 2.3.0
more-itertools 8.3.0
murmurhash 1.0.2
nbconvert 5.6.1
nbformat 5.0.4
networkx 2.2
neuralcoref 4.0
nltk 3.5
notebook 6.0.3
numpy 1.18.5
numpydoc 1.0.0
nvidia-ml-py3 7.352.0
olefile 0.46
opencv-python 3.4.3.18
overrides 3.0.0
packaging 20.4
pandas 1.0.3
pandocfilters 1.4.2
parsimonious 0.8.1
parso 0.6.2
pathlib 1.0.1
pickleshare 0.7.5
Pillow 5.3.0
pip 20.0.2
plac 0.9.6
pluggy 0.13.1
preshed 2.0.1
prometheus-client 0.7.1
prompt-toolkit 3.0.4
protobuf 3.11.3
psutil 5.4.8
py 1.8.1
pycparser 2.20
Pygments 2.6.1
pyhocon 0.3.55
PyNotion 0.0.1
pyOpenSSL 19.1.0
pyparsing 2.3.0
pyrsistent 0.16.0
pySkyscanner 1.0.1
PySocks 1.7.1
pytest 5.4.3
python-dateutil 2.7.5
pytorch-pretrained-bert 0.6.2
pytorch-transformers 1.1.0
pytz 2018.7
PyWavelets 1.0.1
pywin32 227
pywinpty 0.5.7
PyYAML 3.13
pyzmq 18.1.1
regex 2020.4.4
requests 2.23.0
responses 0.10.14
roomai 0.1.16
s3transfer 0.3.3
sacremoses 0.0.41
scandir 1.7
scikit-image 0.14.1
scikit-learn 0.20.1
scipy 1.4.1
seaborn 0.10.0
Send2Trash 1.5.0
sentencepiece 0.1.85
setuptools 39.1.0
six 1.14.0
snowballstemmer 2.0.0
spacy 2.1.9
Sphinx 3.0.4
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 1.0.3
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.4
sqlparse 0.3.1
srsly 1.0.0
tensorboardX 2.0
tensorflow-gpu 1.9.0
termcolor 1.1.0
terminado 0.8.3
testpath 0.4.4
thinc 7.0.8
tokenizers 0.5.2
toolz 0.9.0
torch 1.4.0
torchtext 0.5.0
torchvision 0.5.0
tornado 6.0.4
tqdm 4.45.0
traitlets 4.3.3
transformers 2.8.0
Unidecode 1.1.1
urllib3 1.25.8
visvmtagger 1.0a0
wasabi 0.6.0
wcwidth 0.1.9
webencodings 0.5.1
Werkzeug 1.0.1
wget 3.2
wheel 0.32.3
widgetsnbextension 3.5.1
win-inet-pton 1.1.0
wincertstore 0.2
word2number 1.1
zipp 2.2.0
zope.event 4.4
zope.interface 5.1.0

@SSINsch Are you sure you are running the script from project root? This error seems trivial and is not related to python dependencies.
Also, I would recommend running with --model=probert first, since it has minimum set of dependencies required.
If you are a jupyter user, try running the first cell in usage.ipynb. If everything goes right, then you should be able to reproduce the output exactly.

Yes, I'm running it from project root, as you can see the cmd line.
I'm working with Windows10.

(GAP_test) C:\Users\SHIN-DESKTOP\gap-master>python run.py --preprocess_train --model=probert --language_model=bert-large-uncased --coref_models=url,allen,hug,lee --exp_dir=results\grep
Traceback (most recent call last):
  File "run.py", line 14, in <module>
    from models.model_pipelines import Model
ModuleNotFoundError: No module named 'models.model_pipelines'
(GAP_test) C:\Users\SHIN-DESKTOP\gap-master>dir
2020-06-06  11:35    <DIR>          .
2020-06-06  11:35    <DIR>          ..
2019-12-07  06:41             1,336 .gitignore
2020-05-30  08:57    <DIR>          data
2020-05-30  08:57    <DIR>          externals
2019-12-07  06:41             1,064 LICENSE
2020-06-06  10:53    <DIR>          models
2020-05-30  08:57    <DIR>          paper
2019-12-07  06:41             7,065 README.md
2020-05-30  10:53             8,192 requirements.txt
2019-12-07  06:41             9,955 run.py
2019-12-07  06:41             8,113 score.py
2019-12-07  06:41           171,311 usage.ipynb
2020-05-30  08:57    <DIR>          visualization

And also, the first cell in usage.ipynb does not work, either.
Thank you for your kind reply.

I don't have a windows setup but I'll try to see if I can reproduce this error locally.

Meanwhile, you may want to try adding init.py to each sub-directory that gives you such import errors.

What's you python version?

python 3.6.10.
And I'll try adding init.py. Thanks.