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

Rasa - Failed to load any agent model

我正在将 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'

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

答案就在错误消息本身。

Either retrain the model, or run with an older version.

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

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