lukalabs / cakechat

CakeChat: Emotional Generative Dialog System
Apache License 2.0
1.7k stars 935 forks source link

tools/fetch.py ImportError: DLL load failed: The specified module could not be found. error #61

Closed idkwhyievenhavegithub closed 5 years ago

idkwhyievenhavegithub commented 5 years ago

I am running python 3.6.7 on windows 10 pro and when I try and run the command to download the pre-trained model I get this error related to scipy

Traceback (most recent call last):
  File "tools/fetch.py", line 15, in <module>
    from cakechat.dialog_model.factory import get_trained_model
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\factory.py", line 8, in <module>
    from cakechat.dialog_model.inference_model import InferenceCakeChatModel
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\inference_model.py", line 1, in <module>
    from cakechat.dialog_model.keras_model import KerasTFModelIsolator
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\keras_model.py", line 11, in <module>
    from cakechat.dialog_model.abstract_model import AbstractModel
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\abstract_model.py", line 6, in <module>
    from cakechat.dialog_model.quality.metrics.utils import MetricsSerializer
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\quality\__init__.py", line 2, in <module>
    from cakechat.dialog_model.quality.metrics.lexical_simlarity import calculate_lexical_similarity, get_tfidf_vectorizer
  File "D:\Python\salvation\cakechat\cakechat\dialog_model\quality\metrics\lexical_simlarity.py", line 3, in <module>
    from sklearn.feature_extraction.text import TfidfVectorizer
  File "C:\Python36\lib\site-packages\sklearn\__init__.py", line 76, in <module>
    from .base import clone
  File "C:\Python36\lib\site-packages\sklearn\base.py", line 16, in <module>
    from .utils import _IS_32BIT
  File "C:\Python36\lib\site-packages\sklearn\utils\__init__.py", line 20, in <module>
    from .validation import (as_float_array,
  File "C:\Python36\lib\site-packages\sklearn\utils\validation.py", line 21, in <module>
    from .fixes import _object_dtype_isnan
  File "C:\Python36\lib\site-packages\sklearn\utils\fixes.py", line 18, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
  File "C:\Python36\lib\site-packages\scipy\sparse\linalg\__init__.py", line 113, in <module>
    from .isolve import *
  File "C:\Python36\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>
    from .iterative import *
  File "C:\Python36\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 10, in <module>
    from . import _iterative
ImportError: DLL load failed: The specified module could not be found.
nicolas-ivanov commented 5 years ago

@jnawotka What scipy version do you have? pip list to see it. You need scipy==1.2.1

idkwhyievenhavegithub commented 5 years ago

@nicolas-ivanov I have the version from the requirements text file so it is 1.2.1

nicolas-ivanov commented 5 years ago

@jnawotka Could you, please, post the output of pip list here?

idkwhyievenhavegithub commented 5 years ago

ok here you go

Package                       Version              Location
----------------------------- -------------------- ----------------
2to3                          1.0
absl-py                       0.7.1
aiohttp                       3.5.4
aioslacker                    0.0.11
aiosqlite                     0.10.0
alabaster                     0.7.12
aniso8601                     6.0.0
apixu                         0.2.0
appdirs                       1.4.3
APScheduler                   3.0.1
arrow                         0.13.1
asn1crypto                    0.24.0
astor                         0.7.1
astroid                       2.2.5
async-timeout                 3.0.1
asyncio-redis                 0.15.1
attrs                         18.2.0
Automat                       0.7.0
Babel                         2.6.0
bcrypt                        3.1.6
beautifulsoup4                4.7.1
bleach                        3.1.0
blinker                       1.4
blis                          0.2.4
boto                          2.49.0
boto3                         1.4.4
botocore                      1.5.95
cachetools                    3.0.0
certifi                       2019.3.9
cffi                          1.12.3
chardet                       3.0.4
chatbotAI                     0.2.0.8
ChatterBot                    1.0.5
chatterbot-corpus             1.2.0
Click                         7.0
click-log                     0.1.8
cloudpickle                   0.8.1
cmuclmtk                      0.1.5
colorama                      0.4.1
coloredlogs                   7.3
ConfigArgParse                0.12.0
constantly                    15.1.0
cryptography                  2.6.1
cycler                        0.10.0
cymem                         2.0.2
cytoolz                       0.8.2
dask                          1.2.2
decorator                     4.4.0
defusedxml                    0.6.0
deprecation                   2.0.6
dialogflow                    0.5.2
dill                          0.2.9
discord                       1.0.1
discord.py                    1.1.0
distro                        1.4.0
Django                        2.1.8
django-cors-headers           2.4.1
django-debug-toolbar          1.11
djangorestframework           3.9.4
docopt                        0.6.2
docutils                      0.14
elasticsearch5                5.5.5
emoji                         0.5.2
en-core-web-sm                2.1.0
entrypoints                   0.3
facebook-sdk                  0.4.0
facepy                        1.0.10
factory-boy                   2.11.1
Faker                         1.0.7
fakeredis                     0.8.2
fbmessenger                   4.3.1
fbrecog                       1.6
feedparser                    5.1.3
flake8                        3.7.7
Flask                         1.0.2
Flask-Bcrypt                  0.7.1
Flask-Cors                    3.0.7
Flask-Login                   0.4.1
Flask-Mail                    0.9.1
Flask-RESTful                 0.3.7
Flask-SQLAlchemy              2.4.0
Flask-WTF                     0.14.2
ftfy                          4.4.3
future                        0.16.0
futures                       3.1.1
gast                          0.2.2
gensim                        1.0.1
gevent                        1.2.1
gitdb2                        2.0.5
gitpython                     2.1.11
google                        2.0.2
google-api-core               1.10.0
google-auth                   1.6.3
google-pasta                  0.1.6
google-search                 1.0.2
googleapis-common-protos      1.5.10
goslate                       1.5.1
graphviz                      0.7.1
greenlet                      0.4.15
grpcio                        1.20.1
gunicorn                      19.9.0
h5py                          2.9.0
html5lib                      0.9999999
humanfriendly                 4.18
hyperlink                     19.0.0
idna                          2.8
idna-ssl                      1.1.0
imageio                       2.4.1
imagesize                     1.1.0
immutables                    0.9
incremental                   17.5.0
inflect                       2.1.0
ipython-genutils              0.2.0
isort                         4.3.20
itsdangerous                  1.1.0
jaraco.itertools              4.4.2
jarvis                        0.1.9
Jinja2                        2.10.1
jmespath                      0.9.4
joblib                        0.13.2
jsondatabase                  0.1.7
jsonpickle                    0.9.4
jsonschema                    2.6.0
jupyter-core                  4.4.0
Keras                         2.2.4
Keras-Applications            1.0.7
Keras-Preprocessing           1.0.9
klein                         17.2.0
lazy-object-proxy             1.4.1
lxml                          4.3.3
Markdown                      3.1
MarkupSafe                    1.1.1
mathparse                     0.1.2
matplotlib                    1.5.3
matrix-api-async              0.1.0
matrix-client                 0.3.2
mccabe                        0.6.1
mistune                       0.8.4
mock                          3.0.5
more-itertools                7.0.0
motor                         2.0.0
multidict                     4.5.2
murmurhash                    1.0.2
nbconvert                     5.5.0
nbformat                      4.4.0
nbsphinx                      0.4.2
networkx                      1.11
nltk                          3.4
num2words                     0.5.9
numpy                         1.16.0
opsdroid                      0.15.0
opsdroid-get-image-size       0.2.2
packaging                     19.0
pandas                        0.23.4
pandoc                        1.0.0b2
pandocfilters                 1.4.2
parlai                        0.1.0                d:\python\parlai
parse                         1.12.0
pathlib                       1.0.1
pbr                           5.2.0
pexpect                       4.7.0
Pillow                        6.0.0
Pint                          0.9
pip                           19.1.1
plac                          0.9.6
ply                           3.11
Porcupine                     0.70.0
preshed                       2.0.1
progressbar2                  3.38.0
prompt-toolkit                2.0.9
protobuf                      3.7.1
ptyprocess                    0.6.0
puremagic                     1.5
py                            1.8.0
py-gfm                        0.1.4
PyAIML                        0.8.6
pyaml                         17.12.1
pyasn1                        0.4.5
pyasn1-modules                0.2.5
pycodestyle                   2.5.0
pycparser                     2.19
pycron                        1.0.0
PyDictionary                  1.5.2
pyflakes                      2.1.1
Pygments                      2.3.1
PyHamcrest                    1.9.0
pyjokes                       0.5.0
pykwalify                     1.6.0
pylint                        2.3.1
pymongo                       3.8.0
pypandoc                      1.4
pyparsing                     2.4.0
pyreadline                    2.1
python-crfsuite               0.9.6
python-dateutil               2.8.0
python-mpd                    0.3.0
python-telegram-bot           11.1.0
python-utils                  2.3.0
pyttsx                        1.1
pytz                          2019.1
PyWavelets                    1.0.3
pywin32                       224
PyYAML                        4.2b1
pyzmq                         18.0.1
quantities                    0.12.3
rasa-core                     0.8.2
rasa-nlu                      0.11.4
redis                         2.10.5
regex                         2017.4.5
requests                      2.21.0
rsa                           4.0
ruamel.yaml                   0.15.34
s3transfer                    0.1.13
scikit-image                  0.14.2
scikit-learn                  0.20.2
scipy                         1.2.0
semantic                      1.0.3
semantic-version              2.6.0
setuptools                    39.1.0
sh                            1.12.14
simplejson                    3.11.1
singledispatch                3.4.0.3
six                           1.12.0
sklearn-crfsuite              0.3.6
slackclient                   1.3.1
slacker                       0.9.42
smart-open                    1.8.4
smmap2                        2.0.5
snips-nlu                     0.19.6
snips-nlu-en                  0.2.1
snips-nlu-parsers             0.2.1
snips-nlu-utils               0.8.0
snowballstemmer               1.2.1
soupsieve                     1.9.1
spacy                         2.1.4
spacymoji                     2.0.0
Sphinx                        2.0.1
sphinx-rtd-theme              0.4.3
sphinxcontrib-applehelp       1.0.1
sphinxcontrib-devhelp         1.0.1
sphinxcontrib-htmlhelp        1.0.2
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.2
sphinxcontrib-serializinghtml 1.1.3
SQLAlchemy                    1.2.19
sqlparse                      0.3.0
srsly                         0.0.5
tabulate                      0.8.3
tb-nightly                    1.14.0a20190301
telepot                       12.6
tensorboard                   1.12.2
tensorflow                    1.12.2
tensorflow-estimator          1.13.0
tensorflow-tensorboard        1.5.1
tensorlayer                   2.0.0
termcolor                     1.1.0
testpath                      0.4.2
text-unidecode                1.2
tf-estimator-nightly          1.14.0.dev2019030115
thinc                         7.0.4
toolz                         0.9.0
toposort                      1.5
torch                         1.1.0
torchvision                   0.2.2.post3
tqdm                          4.30.0
traitlets                     4.3.2
Twisted                       19.2.0
typed-ast                     1.3.5
typing                        3.5.3.0
typing-extensions             3.7.2
TzaraIPA                      0.1
tzlocal                       1.5.1
ujson                         1.35
unicodecsv                    0.14.1
Unidecode                     1.0.23
urbandictionary               1.1
urllib3                       1.23
wasabi                        0.2.2
wcwidth                       0.1.7
webencodings                  0.5.1
websocket-client              0.54.0
websocket-server              0.4
websockets                    7.0
Werkzeug                      0.15.2
wheel                         0.33.4
wikipedia                     1.4.0
wit                           5.1.0
wolframalpha                  3.0.1
wrapt                         1.10.11
WTForms                       2.2.1
xmltodict                     0.12.0
yarl                          1.3.0
zope.interface                4.6.0
nicolas-ivanov commented 5 years ago

@jnawotka your python interpreter can potentially load some other version of scipy. For example, if you have several versions of python on your system, you may install packages for one version of python (say, python 2), but launch the interpreter for another (python 3).

In order to avoid this issue, we suggest using a virtual environment and not to install python packages globally, as you did. So, do the following:

# create and activate virtual environment
pip install virtualenv
virtualenv -p python3 venv_cakechat
source venv_cakechat/bin/activate

# now you are in a virtual environment with local python and pip; install the requirements
pip install -r requirements.txt -r requirements-local.txt

#check the installed packages, scipy 1.2.0 should be in the list
pip list

# try fetching the model
cd cakechat
python tools/fetch.py

# leave the virtual environment when you are done
deactivate
idkwhyievenhavegithub commented 5 years ago

@nicolas-ivanov I have tried what you suggested and it still does not work, same error

nicolas-ivanov commented 5 years ago

@jnawotka Let me try to reproduce this issue on my Windows machine a bit later (need to rehabilitate it first :)

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ko1ster commented 5 years ago

Have the same issue. Using miniconda env, python 3.6.8, tensorflow 1.12.2

ko1ster commented 5 years ago

Actually it was kind of mess with packages. Reinstall them and all is nice

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.