问题
I’ve got this error, just following the « Getting Started with Rasa » tutorial
So I’ve typed:
sudo pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple
which seems to work fine but when I’ve typed:
sudo rasa init
I’ve got a lot of errors among them:
rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy ‘MemoizationPolicy’ could not be loaded. Please make sure the name is a valid policy.
回答1:
I faced the same problem when I tried using - rasa init. This is solved by paying attention to 2 things. When you try to install rasa using - pip install rasa in a virtual environment. This install latest python version, in my case this was 3.8, but the problem was that TensorFlow support was not available for 3.8, So I will suggest-
conda create --name rasa python=3.6
For anaconda or you could also create a virtual environment. Now use
pip install rasa
Now you will notice TensorFlow==1.15.1 will be installed. For rasa to work we will need TensorFlow==1.15.0
pip uninstall tensorflow
pip install tensorflow-cpu==1.15.0
if you want CPU support only otherwise,
pip install tensorflow==1.15.0
This worked for me.
回答2:
In fact, it was a dependencies nightmare.
So what I’ve done to get a rasa chatbot up and running:
- Reinstall dask (but I’m not sure this step is mandatory)
sudo pip3 install "dask[complete]"
- Downgraded my version of pandas
sudo pip3 install pandas==0.19.2
- Upgraded tqdm
sudo pip3 install -U tqdm
- Upgraded OpenAI gym
sudo pip3 install -U gym
Et voilà!
来源:https://stackoverflow.com/questions/59257759/rasa-chatbot-rasa-core-policies-ensemble-invalidpolicyconfig-module-for-policy