首页 文章

Rasa - 无法加载任何代理模型

提问于
浏览
1

我正在使用Rasa进行聊天机器人项目 . 之前它工作得很好,但是现在我需要让它在另一台机器上运行(Ubuntu,使用python 3.6),我得到了奇怪的错误 .

这是我的安装命令:

pip3 install rasa_nlu
pip3 install rasa_nlu[spacy]
pip3 install -U spacy
python3 -m spacy download fr
pip3 install rasa_core

然后我训练了rasa-nlu:

python3 -m rasa_nlu.train -d data/intents.md -c config.yml

服务器使用以下命令运行:

python3 -m rasa_nlu.server --path models/nlu -c config.yml

我训练了rasa-core:

python3 -m rasa_core.train -s data/stories.md -d domain.yml -o models/dialogue --epochs 300

但是当我尝试使用此命令运行核心服务器时:

python3 -m rasa_core.server -d models/dialogue -u models/nlu/default/myproject -o out.log

我收到了这个错误:

Failed to load any agent model.
Running Rasa Core server with out loaded model now.
The model version is to old to be loaded by this Rasa NLU instance.
Either retrain the model, or run with an older version.
Model version: 0.11.3
Instance version: 0.12.3

我在 models/nlu/default/myproject/metadata.json 中将 "rasa_nlu_version" 更改为 "0.12.3" .

现在我收到这个错误:

Failed to load any agent model.
Running Rasa Core server with out loaded model now.
'str' objet has no attribute 'get'

有人可以帮我调试吗?谢谢 .

1 回答

  • 2

    您的答案在于错误消息本身 .

    重新训练模型,或使用旧版本运行 .

    只需重新训练模型并再次运行服务器和 rasa_core . 确保用于运行服务器的模型与training config 文件中指定的模型相同 . 即确保您加载的是刚刚训练过的模型而不是旧模型 .

    P.S.Changing metadata.json 文件是一个坏主意 . 它是在训练模型时自动创建的 .

相关问题