Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error 2] No such file or directory #684

Closed
harirehm opened this issue Nov 10, 2017 · 5 comments
Closed

[Error 2] No such file or directory #684

harirehm opened this issue Nov 10, 2017 · 5 comments

Comments

@harirehm
Copy link

Rasa NLU version (e.g. 0.10.4):

Used backend / pipeline (spacy_sklearn):

Operating system (Linux):

Issue:
I'm facing the above error when I tried to up the server. The same happens when I try to train a model. And I am sure the file is present in the mentioned directory. It was working fine up to last night. When I trained a model, I was successful yesterday but, when I tried to hit the newly trained model with RASA HTTP api, it said connection timed out. So, I updated RASA NLU to the latest version last night (not sure about the version of my older one). And today, the server went down. When I tried to make it up again, this is what I get.

log:
INFO:root:Loading model './model_main'... INFO:root:Trying to load spacy model with name 'en' ERROR:root:Failed to load model './model_main'. Error: [Errno 2] No such file or directory Traceback (most recent call last): File "rasa_nlu/data_router.py", line 87, in __create_model_store model_store[alias] = self.__interpreter_for_model(model_path) File "rasa_nlu/data_router.py", line 71, in __interpreter_for_model return Interpreter.load(metadata, self.config, self.component_builder) File "rasa_nlu/model.py", line 218, in load component = component_builder.load_component(component_name, context, model_ config, meta) File "rasa_nlu/components.py", line 342, in load_component component = registry.load_component_by_name(component_name, context, model_c onfig) File "rasa_nlu/registry.py", line 92, in load_component_by_name return load_component(component_clz, context, config) File "rasa_nlu/components.py", line 30, in load_component return component_clz.load(*load_args) File "rasa_nlu/utils/spacy_utils.py", line 90, in load return cls.create(language, spacy_model_name) File "rasa_nlu/utils/spacy_utils.py", line 51, in create nlp = spacy.load(spacy_model_name, parser=False) File "/usr/lib64/python2.7/site-packages/spacy/__init__.py", line 19, in load return util.load_model(name, **overrides) File "/usr/lib64/python2.7/site-packages/spacy/util.py", line 111, in load_mod el return load_model_from_link(name, **overrides) File "/usr/lib64/python2.7/site-packages/spacy/util.py", line 125, in load_mod el_from_link cls = import_file(name, path) File "/usr/lib64/python2.7/site-packages/spacy/compat.py", line 115, in import _file return imp.load_source(name, loc) IOError: [Errno 2] No such file or directory INFO:root:Started http server on port 5001

Content of configuration file

{
  "pipeline": "spacy_sklearn",
  "path": "./rasa/models",
  "data" : "./rasa/data/demo-rasa.json",
   "server_model_dirs": {
    "default" : "./model_main"
  }
}

Note:- The directory/ file name of the models and the content of configuration file is the same as yesterday. The error just appeared today.

@harirehm
Copy link
Author

Resolved it. Seems like the models are getting trained in a new folder named default in the new version of RASA NLU. That is, <path-for-model-dir>/default/my_model. In my case, I moved my models from <rasa-nlu>/rasa/models to <rasa-nlu>/rasa/default/models. Everything came back fine!

@wrathagom
Copy link
Contributor

Sounds like maybe you're updating from a previous version. There are q few structural changes that have taken place with the implementation of "projects" http://rasa-nlu.readthedocs.io/en/latest/http.html?highlight=project#post-parse-no-emulation

@harirehm
Copy link
Author

Great @wrathagom. Can you give me the proper versions of that I should be using for RASA. My server with older model is fine, and the training goes fine. But when I bring up the server with the newly trained model, it throws error.

INFO:root:Loading model './model_main'...
INFO:root:Trying to load spacy model with name 'en'
INFO:root:Added 'nlp_spacy' to component cache. Key 'nlp_spacy-en'.
ERROR:root:Failed to load model './model_main'. Error: 1
Traceback (most recent call last):
  File "rasa_nlu/data_router.py", line 87, in __create_model_store
    model_store[alias] = self.__interpreter_for_model(model_path)
  File "rasa_nlu/data_router.py", line 71, in __interpreter_for_model
    return Interpreter.load(metadata, self.config, self.component_builder)
  File "rasa_nlu/model.py", line 218, in load
    component = component_builder.load_component(component_name, context, model_config, meta)
  File "rasa_nlu/components.py", line 342, in load_component
    component = registry.load_component_by_name(component_name, context, model_config)
  File "rasa_nlu/registry.py", line 92, in load_component_by_name
    return load_component(component_clz, context, config)
  File "rasa_nlu/components.py", line 30, in load_component
    return component_clz.load(*load_args)
  File "rasa_nlu/extractors/spacy_entity_extractor.py", line 108, in load
    ner = EntityRecognizer.load(pathlib.Path(ner_dir), spacy_nlp.vocab)
  File "spacy/syntax/parser.pyx", line 154, in spacy.syntax.parser.Parser.load (spacy/syntax/parser.cpp:6999)
    self = cls(vocab, TransitionSystem=TransitionSystem, model=None, **cfg)
  File "spacy/syntax/parser.pyx", line 177, in spacy.syntax.parser.Parser.__init__ (spacy/syntax/parser.cpp:7370)
    cfg['actions'] = TransitionSystem.get_actions(**cfg)
  File "spacy/syntax/ner.pyx", line 71, in spacy.syntax.ner.BiluoPushDown.get_actions (spacy/syntax/ner.cpp:3906)
    actions[action].append(entity_type)
KeyError: 1

And I tried to clone rasa in a separate directory and do a fresh install (thought that would resolve any version conflicts). And that's causing the below error while bringing up the server.

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/ec2-user/chatbots/rasa-latest/rasa_nlu/rasa_nlu/server.py", line 14, in <module>
    from klein import Klein
  File "/usr/lib/python2.7/site-packages/klein/__init__.py", line 3, in <module>
    from klein.app import Klein, run, route, resource
  File "/usr/lib/python2.7/site-packages/klein/app.py", line 28, in <module>
    from twisted.internet import reactor, endpoints
  File "/usr/lib64/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 44, in _getInstallFunction
    from twisted.internet.epollreactor import install
  File "/usr/lib64/python2.7/site-packages/twisted/internet/epollreactor.py", line 24, in <module>
    from twisted.internet import posixbase
  File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/usr/lib64/python2.7/site-packages/twisted/internet/_sslverify.py", line 38, in <module>
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

Note: I am not disturbing my older server. I am trying to bring up my new server with a different port.

Below are the versions that's currently installed in my system:
RASA NLU : 0.10.4
python : 2.7.13
numpy : 1.13.3
spacy : 2.0.2
scikit-learn : 0.19.1

@harirehm harirehm reopened this Nov 11, 2017
@tmbo
Copy link
Member

tmbo commented Nov 17, 2017

@harirehm did you take a look at this? scrapy/scrapy#2473

@wrathagom
Copy link
Contributor

@harirehm I'm closing, but let us know if there is anything else that was needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants