rasa_nlu.model.UnsupportedModelError:此Rasa NLU实例要加载的模型版本较旧

问题描述 投票:0回答:1

我正在使用rasa构建聊天机器人。 train_online.py文件中有错误。

我移至最新版本的rasa_nlu == 0.15.1,但仍收到错误。

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from rasa_core import utils, train
from rasa_core.training import online
from rasa_core.interpreter import NaturalLanguageInterpreter
logger = logging.getLogger(__name__)
def train_agent(interpreter):
    return train.train_dialog_model(domain_file="horoscope_domain.yml",
                                      stories_file="data/stories.md",
                                      output_path="models/dialog",
                                      nlu_model_path=interpreter,
                                      endpoints="endpoints.yml",
                                      max_history=2,
                                      kwargs={"batch_size": 50,
                                              "epochs": 200,
                                              "max_training_samples": 300
                                              })
if __name__ == '__main__':
    utils.configure_colored_logging(loglevel="DEBUG")
    nlu_model_path = "/home/zain/models/dialogue"
    interpreter = NaturalLanguageInterpreter.create(nlu_model_path)
    agent = train_agent(interpreter)
    online.serve_agent(agent)

这是错误

“”。format(model_version,rasa_nlu。version))rasa_nlu.model.UnsupportedModelError:模型版本过旧由此Rasa NLU实例加载。重新训练模型或运行使用旧版本。型号版本:0.0.0实例版本:0.15.0

python machine-learning rasa-nlu
1个回答
0
投票

似乎您的RASA版本低于0.15。您可以通过使用命令

重新训练模型来解决此问题
python -m rasa_core.train -d domain.yml -s data/stories.md \
  -o models/current/dialogue -c config.yml 

但是我建议您迁移到RASA 1.2.4版本。有很多更改,使我们可以轻松使用RASA。我最近从0.14.1版本迁移到1.2.4,这使我受益匪浅。

仍然,如果您希望使用0.15版本,则将此link用于RASA文档。另外,您可以去使用最新的RASA文档here

© www.soinside.com 2019 - 2024. All rights reserved.