Closed antoinecomp closed 6 years ago
I crafted a solution : as far as the problem was with RasaNLUInterpreter unable to read the .pkl
files I just created the /models/nlu/default/weathernlu/test
folder and copied all .json files into it and modified the main in train_online.py file
with :
nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu/test')
And it worked as a charm.
Hey. Glad you found a solution. I am pretty sure the issue was due to the different version of Rasa NLU which I used for the video. Thanks for pointing that out, I will make sure to update the tutorial so that new readers wouldn't get confused :)
Yes, I don't know if it is a good solution though, It was a bit of mac gayver :/
I have seen that you still calls to the .pkl files in nlu_model.py
whereas it creates an issue with interpreter=Interpreter.load('./models/nlu/default/weathernlu')
:
Traceback (most recent call last):
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 508, in _unpickle
obj = unpickler.load()
File "/usr/lib/python3.5/pickle.py", line 1039, in load
dispatch[key[0]](self)
File "/usr/lib/python3.5/pickle.py", line 1177, in load_binstring
self.append(self._decode_string(data))
File "/usr/lib/python3.5/pickle.py", line 1159, in _decode_string
return value.decode(self.encoding, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9f in position 36: ordinal not in range(128)
...
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 523, in _unpickle
raise new_exc
ValueError: You may be trying to read with python 3 a joblib pickle generated with python 2. This feature is not supported by joblib.
Indeed, there is some .pkl
files in models/nlu/default/weathernlu
:
(MoodEnv) mike@mike-thinks:~/Programing/Rasa/Moodbot/models/nlu/default/weathernlu$ ls
crf_model.pkl intent_classifier_sklearn.pkl metadata.json training_data.json
I thought it was a good solution to get rid of these files but as far as I am still unable to get Rasa NLU understand my intents I am now unsure about it ...
Actually I was wrong. My chatbot wasn't able to recognize intent anymore and this was due to the odd reason that I have to reinstalled the backend :
pip install rasa_nlu[spacy]
python -m spacy download en_core_web_md
python -m spacy link en_core_web_md en
The weird thing is that I think I will have to reinstall them every time I launch again the project ...
Rasa Core version:
Python version:
Operating system : Linux 16.04
Issue:
When trying to launch file
train_online.py
, the actual conversation chatbot able to send messages, there were issuesYet the following error appeared :
I know it means that compatibility across python versions is not fully supported but I don't understand why and what can I do to cope with it.
Just to inform myself I tried to launch the code using Python 2 explicitly : and it gave me :
Which is an issue they already dealt with here but which is unexpected as far as my rasa-core version is one of the latest.
I think the problem is either RasaNLUInterpreter module has changed for another here or it is impossible for RasaNLUInterpreter to read the
.pkl
extension files :Content of domain file :