Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rasa train出错 #89

Open
zengyazy opened this issue Jul 17, 2020 · 3 comments
Open

rasa train出错 #89

zengyazy opened this issue Jul 17, 2020 · 3 comments

Comments

@zengyazy
Copy link

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 "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 953, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'policy'

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
File "f:\soft\envs\py37\lib\site-packages\rasa_main
.py", line 70, in main
cmdline_arguments.func(cmdline_arguments)
File "f:\soft\envs\py37\lib\site-packages\rasa\cli\train.py", line 84, in train
kwargs=extract_additional_arguments(args),
File "f:\soft\envs\py37\lib\site-packages\rasa\train.py", line 40, in train
kwargs=kwargs,
File "f:\soft\envs\py37\lib\asyncio\base_events.py", line 587, in run_until_complete
return future.result()
File "f:\soft\envs\py37\lib\site-packages\rasa\train.py", line 135, in train_async
kwargs=kwargs,
File "f:\soft\envs\py37\lib\site-packages\rasa\train.py", line 174, in _do_training
kwargs=kwargs,
File "f:\soft\envs\py37\lib\site-packages\rasa\train.py", line 303, in _train_core_with_validated_data
kwargs=kwargs,
File "f:\soft\envs\py37\lib\site-packages\rasa\core\train.py", line 36, in train
policies = config.load(policy_config)
File "f:\soft\envs\py37\lib\site-packages\rasa\core\config.py", line 24, in load
return PolicyEnsemble.from_dict(config_data)
File "f:\soft\envs\py37\lib\site-packages\rasa\core\policies\ensemble.py", line 287, in from_dict
"".format(policy_name)
请问有人也出现这个问题的吗o(╥﹏╥)o刚学rasa的小白

@HYQQYH
Copy link

HYQQYH commented Aug 25, 2020

@zengyazy 请问你解决了吗这个问题,我也碰到了,还没找到解决方法

@GaoQ1
Copy link
Owner

GaoQ1 commented Aug 26, 2020

试试export PYTHONPATH=/path/to/your/policy

@zengyazy
Copy link
Author

@HYQQYH 刚刚作者回答了这个问题,你可以试试 export PYTHONPATH=/path/to/your/policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants