rasa_chatbot_cn
rasa_chatbot_cn copied to clipboard
rasa train出错
rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy 'policy.attention_policy.AttentionPolicy' could not be loaded. Please make sure the name is a valid policy.在rasa train 时出现以上错误。
python3.7
win10
rasa 1.1.3
rasa-core 0.14.5
rasa-core-sdk 0.14.0
rasa-nlu 0.15.1
rasa-nlu-gao 1.0.3
rasa-sdk 1.1.1
Traceback (most recent call last):
File "f:\soft\envs\py37\lib\site-packages\rasa\core\registry.py", line 20, in policy_from_module_path
return class_from_module_path(module_path, lookup_path="rasa.core.policies")
File "f:\soft\envs\py37\lib\site-packages\rasa\utils\common.py", line 188, in class_from_module_path
m = importlib.import_module(module_name)
File "f:\soft\envs\py37\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "f:\soft\envs\py37\lib\site-packages\rasa\core\policies\ensemble.py", line 279, in from_dict constr_func = registry.policy_from_module_path(policy_name) File "f:\soft\envs\py37\lib\site-packages\rasa\core\registry.py", line 22, in policy_from_module_path raise ImportError("Cannot retrieve policy from path '{}'".format(module_path)) ImportError: Cannot retrieve policy from path 'policy.attention_policy.AttentionPolicy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "f:\soft\envs\py37\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "f:\soft\envs\py37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "F:\soft\envs\py37\Scripts\rasa.exe_main.py", line 7, in
@zengyazy 请问你解决了吗这个问题,我也碰到了,还没找到解决方法
试试export PYTHONPATH=/path/to/your/policy
@HYQQYH 刚刚作者回答了这个问题,你可以试试 export PYTHONPATH=/path/to/your/policy