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

ImportError: cannot import name 'RasaNLUConfig' #2057

Closed
Harish0596 opened this issue Apr 18, 2018 · 18 comments
Closed

ImportError: cannot import name 'RasaNLUConfig' #2057

Harish0596 opened this issue Apr 18, 2018 · 18 comments

Comments

@Harish0596
Copy link

Rasa Core version: 0.8.5

Python version: 3.6.4

Operating system (windows, osx, ...): windows 10

Issue:
I have recently updated to RASA NLU v0.12.0 after the update i'm getting this issue

Traceback (most recent call last):
  File ".\bot.py", line 25, in <module>
    run_bot()
  File ".\bot.py", line 16, in run_bot
    agent = Agent.load('./models/dialogue/default/dialogue_model', RasaNLUInterpreter('./models/nlu/default/nlu_model'))
  File "D:\Softwares\Python\lib\site-packages\rasa_core\interpreter.py", line 219, in __init__
    self._load_interpreter()
  File "D:\Softwares\Python\lib\site-packages\rasa_core\interpreter.py", line 234, in _load_interpreter
    from rasa_nlu.config import RasaNLUConfig
ImportError: cannot import name 'RasaNLUConfig'

I got this error while using the following method

agent = Agent.load('./models/dialogue/default/dialogue_model', RasaNLUInterpreter('./models/nlu/default/nlu_model'))
@tmbo
Copy link
Member

tmbo commented Apr 18, 2018

We haven't released a new version of rasa core yet that works with NLU 0.12.x - the master version from github should be fine though. We are working on a new release that will be compatible, but it will take a couple days as there are some open PR's that need to be finished up first.

@tmbo
Copy link
Member

tmbo commented Apr 18, 2018

For the time being, I created an alpha release that should show up on pypi in a couple minutes.

So if you want to use nlu 0.12.x together with core, you can pip install rasa_core==0.9.0a2.

@Harish0596
Copy link
Author

@tmbo I see two versions were released with time gap of 30 min which one is stable?

@tmbo
Copy link
Member

tmbo commented Apr 20, 2018

So the 0.8.6 one is the latest stable one and the 0.9.0a2 is a tagged release from the current development version (which is tested and stable as well, but not yet feature complete and that is why we can not yet release the next major version 0.9.0 for core).

@ctrado18
Copy link

ctrado18 commented Apr 30, 2018

I wanted test the new 12.2 but I face same issue. which version of core I have to install now which is working like latest stable but together with 12.2? Shall I use 0.9.0a2 or 0.9.0a3?

@ctrado18
Copy link

ctrado18 commented Apr 30, 2018

I ugraded to 0.9.0a2 and get:

Traceback (most recent call last):
  File "dialoguepy", line 45, in <module>
    run_bot()
  File "dialogue_management_model.py", line 35, in run_bot
    interpreter = RasaNLUInterpreter('./models/nlu/default/kk_nlu')
  File "C:\Users\Anaconda3\envs\rasa12\lib\site-packages\rasa_core\interpreter.py", line 221, in __init__
    self._load_interpreter()
  File "C:\Users\Anaconda3\envs\rasa12\lib\site-packages\rasa_core\interpreter.py", line 237, in _load_interpreter
    self.interpreter = Interpreter.load(self.model_directory)
  File "C:\Users\Anaconda3\envs\rasa12\lib\site-packages\rasa_nlu\model.py", line 272, in load
    Interpreter.ensure_model_compatibility(model_metadata)
  File "C:\Users\Anaconda3\envs\rasa12\lib\site-packages\rasa_nlu\model.py", line 264, in ensure_model_compatibility
    rasa_nlu.__version__))
rasa_nlu.model.UnsuportedModelError: The model version is to old to be loaded by this Rasa NLU instance. Either retrain the model, or run withan older version. Model version: 0.12.0a1 Instance version: 0.12.2

@fdevillard
Copy link

It should work, but you have to retrain your NLU model using 12.2.x

@akelad
Copy link
Contributor

akelad commented May 1, 2018

i'll close for now, let us know if you encounter any more issues

@akelad akelad closed this as completed May 1, 2018
@antoinecomp
Copy link

antoinecomp commented May 17, 2018

Hi, I referenced to this issue because I had the same one and I don't know how to upgrade to a new version and which.

My error message was :

rasa_nlu.model.UnsupportedModelError: The model version is to old to be loaded by this Rasa NLU instance. Either retrain the model, or run withan older version. Model version: 0.9.0a4 Instance version: 0.12.3

@amir-rafieian
Copy link

amir-rafieian commented Jul 6, 2018

I have the same problem:

rasa-core = 0.9.7
rasa-nlu = 0.12.3

I just followed the installation instruction on Rasa webpage:

pip install rasa_core
pip install rasa_nlu[spacy]
python -m spacy download en_core_web_lg
python -m spacy link en_core_web_lg en

UPDATE:
I`ve downgraded to version 11.5 and problem solved:

pip install rasa-nlu==0.11.5

@Ghostvv
Copy link
Contributor

Ghostvv commented Jul 6, 2018

@antoinecomp did you try to retrain after you reinstalled rasa?

@samrudh
Copy link

samrudh commented Aug 7, 2018

working combination to resolve this error:
rasa_nlu = 0.11.5
rasa_core = 0.10.3

@antoinecomp
Copy link

@Ghostvv Yes, Probably !

@akelad
Copy link
Contributor

akelad commented Aug 8, 2018

Any reason why not to upgrade to 0.10 and 0.13? 😄
You usually need to retrain models anyways when upgrading to major versions as there can be breaking changes

@serdarbozoglan
Copy link

I have the same problem

from rasa_nlu.config import RasaNLUConfig

is not working. I am using the 0.14.3 version of rasa_nlu. What could be the problem

@Ghostvv
Copy link
Contributor

Ghostvv commented Feb 5, 2019

@serdarbozoglan it doesn't exist in rasa_nlu 0.14.3

@bghanchi
Copy link

bghanchi commented Feb 26, 2019

when i run
->from rasa_nlu.converters import load_data
->from rasa_nlu.model import Trainer
they work fine

but when i run -> from rasa_nlu.config import RasaNLUConfig
then i get
cannot import name 'RasaNLUConfig'
why

  • Also when i run import rasa_nlu.config then it's work also fine
  • version->rasa_nlu =0.11.5 and rasa_core=0.10.3

@Ghostvv
Copy link
Contributor

Ghostvv commented Feb 27, 2019

please try RasaNLUModelConfig instead

@tmbo tmbo transferred this issue from RasaHQ/rasa_core Mar 21, 2019
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