Not able to run dialogue_management_model.py

This is the code which I am trying to execute :

from future import absolute_import from future import division from future import print_function from future import unicode_literals

import logging import rasa_core from rasa_core.agent import Agent from rasa_core.policies.keras_policy import KerasPolicy from rasa_core.policies.memoization import MemoizationPolicy from rasa_core.interpreter import RasaNLUInterpreter from rasa_core.utils import EndpointConfig from rasa_core.run import serve_application from rasa_core import config

logger = logging.getLogger(name)

def train_dialogue(domain_file = ‘weather_domain.yml’, model_path = ‘./models/dialogue’, training_data_file = ‘./data/stories.md’):

agent = Agent(domain_file, policies = [MemoizationPolicy(), KerasPolicy(max_history=3, epochs=200, batch_size=50)])
data = agent.load_data(training_data_file)	


agent.train(data)
			
agent.persist(model_path)
return agent

def run_weather_bot(serve_forever=True): interpreter = RasaNLUInterpreter(’./models/nlu/default/weathernlu’) action_endpoint = EndpointConfig(url=“http://localhost:5055/webhook”) agent = Agent.load(’./models/dialouge’, interpreter=interpreter, action_endpoint=action_endpoint) rasa_core.run.serve_application(agent ,channel=‘cmdline’)

return agent

if name == ‘main’: train_dialogue() run_weather_bot()

But it gives this error. Please help me with this error.


Traceback (most recent call last): File “dialouge_management_model.py”, line 41, in run_weather_bot() File “dialouge_management_model.py”, line 32, in run_weather_bot interpreter = RasaNLUInterpreter(’./models/nlu/default/weathernlu’) File “c:\users\kastu\chatbot\rasa_core\rasa_core\interpreter.py”, line 231, in init self._load_interpreter() File “c:\users\kastu\chatbot\rasa_core\rasa_core\interpreter.py”, line 247, in load_interpreter self.interpreter = Interpreter.load(self.model_directory) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\rasa_nlu\model.py”, line 293, in load skip_validation) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\rasa_nlu\model.py”, line 320, in create model_metadata, **context) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\rasa_nlu\components.py”, line 419, in load_component cached_component, **context) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\rasa_nlu\registry.py”, line 133, in load_component_by_name return component_clz.load(model_dir, metadata, cached_component, **kwargs) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\rasa_nlu\utils\spacy_utils.py”, line 126, in load nlp = spacy.load(model_name, parser=False) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\spacy_init.py", line 21, in load return util.load_model(name, **overrides) File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\spacy\util.py”, line 119, in load_model raise IOError(Errors.E050.format(name=name)) OSError: [E050] Can’t find model ‘None’. It doesn’t seem to be a shortcut link, a Python package or a valid path to a data directory.

@Nikhileshorg I am also facing the same issue.

Surprised to see you facing this alone for this long. Hunting for answers, I bumped on this

But could not make it work for my Virtualenv.

Hope someone from RASA team helps us fix this.

1 Like