1

我正在研究 rasa.com、apixu、api.slack 的聊天机器人。但当时想训练数据,偶出这样的错误。你能帮我解决这个问题吗?

顺便说一句,我使用 anaconda3,python 3.6。


C:\Program Files\Anaconda3>python train_init.py

C:\Program Files\Anaconda3\lib\site-packages\h5py__init__.py:34: FutureWarning: issubdtype 的第二个参数从floatto的转换np.floating已弃用。将来,它将被视为np.float64 == np.dtype(float).type.

从 ._conv 导入 register_converters 作为 _register_converters

使用 TensorFlow 后端。

回溯(最后一次调用):文件“train_init.py”,第 17 行,在 agent = Agent('weather_domain.yml', policies = [MemoizationPolicy(), KerasPolicy()])

文件“C:\Program Files\Anaconda3\lib\site-packages\rasa_core\agent.py”,第 42 行,在init

self.domain = self._create_domain(domain)

_create_domain 中的文件“C:\Program Files\Anaconda3\lib\site-packages\rasa_core\agent.py”,第 237 行

return TemplateDomain.load(domain)

文件“C:\Program Files\Anaconda3\lib\site-packages\rasa_core\domain.py”,第 435 行,加载中

slots = cls.collect_slots(data.get("slots", {}))

文件“C:\Program Files\Anaconda3\lib\site-packages\rasa_core\domain.py”,第 479 行,在 collect_slots

slot_class = Slot.resolve_by_type(slot_dict[slot_name].get("type"))

AttributeError:“NoneType”对象没有属性“get”

4

1 回答 1

0

In your case slot_dict[slot_name] is None. Make sure it is not None but some object. Here is the same error in a simplified way reflecting what happened in your scenario:

>>> d = {'key': None}
>>> d['key'].get('type')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'get'
于 2018-03-29T03:56:17.747 回答