Rasa: Unable to initialize persistor

Created on 23 Aug 2018  路  14Comments  路  Source: RasaHQ/rasa

Rasa NLU version:0.12.3

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

Content of model configuration file:

language: "en"

pipeline: "spacy_sklearn"

Issue:
I am trying to run the Rasa NLU server and communicate to it through POST to extract intent but getting error Unable to initialize persistor

Here is what I do:

I am training the nlu model like below:

def train_nlu(data, configuration, model_dir, model_name):
    training_data = load_data(data)
    trainer = Trainer(config.load(configuration))
    trainer.train(training_data)
    model_directory = trainer.persist(model_dir, fixed_model_name = model_name)
    return model_directory

if __name__ == '__main__':
    model_directory = train_nlu('./data/data.json', 'config_spacy.yml', './models/nlu', 'renewalnlu')

Then in the command line

Running the NLU server

$python -m rasa_nlu.server --path /PATH/renewalBot/models/nlu

And
$curl --request POST --url http://localhost:5000/parse --header 'content-type: application/json' --data '{ "q": "hello"}' | python -mjson.tool

This is returning error Unable to initialize persistor

Any suggestion?

type

Most helpful comment

where exactly is your model saved? I suspect the path you provide isn't quite right,

if you model is at e.g. PATH/renewalBot/models/nlu/model_xx then you would want --path PATH/renewalBot/models and then specify project nlu and model model_xx

All 14 comments

where exactly is your model saved? I suspect the path you provide isn't quite right,

if you model is at e.g. PATH/renewalBot/models/nlu/model_xx then you would want --path PATH/renewalBot/models and then specify project nlu and model model_xx

@amn41
NLU Model at PATH/renewalBot/models/nlu/default/renewalnlu

Essentially my project name is default

So what should be the entire command?

should then be --path PATH/renewalBot/models/nlu/

and query:

$curl --request POST --url http://localhost:5000/parse?model=renewalnlu --header 'content-type: application/json' --data '{ "q": "hello"}' | python -mjson.tool

@amn41 Still getting the same error

what's the output of curl localhost:5000/status ?

@amn41 below

{
  "available_projects": {
    "default": {
      "status": "ready",
      "available_models": [
        "renewalnlu"
      ],
      "loaded_models": []
    }
  }

that's odd! I just reproduced your setup on my machine and can't reproduce the error (on v0.13.1). is this still happening? Could you please update your version?

Similar error is still happening to me as well.

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.

This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.

I am also facing same issue
{
"max_training_processes": 1,
"current_training_processes": 0,
"available_projects": {
"current": {
"status": "ready",
"current_training_processes": 0,
"available_models": [
"dialogue"
],
"loaded_models": []
}
}
}

Happens to me as well. It seems that this happens if I use --fixed_model_name [name] when training.

Version is rasa_nlu==0.14.6.

Thank you @aqiank

@aqiank I get the same error if I use --fixed_model_name [name]. If I remove that, it's working. I am using version 0.15.0.

Was this page helpful?
0 / 5 - 0 ratings