ValueError: bad input shape (1, 3)

Hi,

I had been trying to run a nlu model as per a tutorial, and the interpreter.parse throws an error ValueError: bad input shape (1, 3) when I pass a text message to it. I am using Python 3.7 and I could traceback the error to be coming from sklearn/utils/validation.py. Can anyone help me overcome this?

Thanks in advance.

python 3.7 isn’t officially supported yet. Downgrade to py36 please. But i assume it’s probably because you’re trying to load an old NLU model

I tried that as well. However now the error is AttributeError: 'SVC' object has no attribute '_impl

I am following a tutorial from @Juste and had been cross verifying the code she has published for newer version of rasa as well.

Hey @labeebee. I will look into it, chances are the NLU modles needs retraining. Have you tried it (rerunning train_nlu.py)?

Yay! that worked! Thanks @Juste. What could have been the reason tho?

@labeebee I guess you are using a little bit different version of Rasa NLU than I did for the tutorial which caused the difference in feature dimensions which were used when I trained the model vs when you tested :slight_smile:

I’m facing the same error while running the model. interpreter.parse throws an error ValueError: bad input shape (1, 3) when I pass a text message to it. I could traceback the error to be coming from sklearn/utils/validation.py . Please help. I am using python 3.6, rasa-nlu 0.13.8, scikit-learn 0.20.1, spacy 2.0.18, sklearn-crfsuite 0.3.6

Issue resolved using scikit-learn==0.19.1