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

test rasa nlu时报错builtins.ValueError: bad input shape (1, 13) #33

Open
jinyang10014 opened this issue Apr 9, 2019 · 5 comments
Open

Comments

@jinyang10014
Copy link

你好,我按照Readme.md一步步搭建环境,做到"test rasa nlu"这一步时遇到解决不掉的问题,执行【python httpserver.py】可以正常启动,新开窗口执行curl命令后,httpserver端报错“Unhandled Error”、“builtins.ValueError: bad input shape (1, 13)”,这里不会解决了,请问这个是什么情况啊,需要如何解决?我的操作系统是CentOS 6.3。

@zqhZY
Copy link
Owner

zqhZY commented Apr 11, 2019

确认下rasa版本试试:rasa_core==0.9.0

@nihuizhidao
Copy link

nihuizhidao commented Apr 27, 2019

我也遇到这个问题,rasa版本是对的, python3.5。报错信息:

2019-04-27 10:18:12+0800 [-] Log opened.
2019-04-27 10:18:12+0800 [-] Site starting on 1235
2019-04-27 10:18:12+0800 [-] Starting factory <twisted.web.server.Site object at 0x7f62a257b400>
2019-04-27 10:18:17+0800 [-] {'q': '我的流量还剩多少'}
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 1.152 seconds.
Prefix dict has been built succesfully.
2019-04-27 10:18:18+0800 [-] Unhandled Error
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.5/site-packages/twisted/web/server.py", line 259, in render
body = resrc.render(self)
File "/home/ubuntu/.local/lib/python3.5/site-packages/klein/resource.py", line 210, in render
d = defer.maybeDeferred(_execute)
File "/home/ubuntu/.local/lib/python3.5/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
result = f(*args, **kw)
File "/home/ubuntu/.local/lib/python3.5/site-packages/klein/resource.py", line 204, in _execute
**kwargs)
--- ---
File "/home/ubuntu/.local/lib/python3.5/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
result = f(*args, **kw)
File "/home/ubuntu/.local/lib/python3.5/site-packages/klein/app.py", line 128, in execute_endpoint
return endpoint_f(self._instance, *args, **kwargs)
File "/home/ubuntu/.local/lib/python3.5/site-packages/klein/app.py", line 227, in _f
return _call(instance, f, request, *a, **kw)
File "/home/ubuntu/.local/lib/python3.5/site-packages/klein/app.py", line 50, in _call
result = f(*args, **kwargs)
File "httpserver.py", line 48, in save_item
pred = self.interpreter.parse(data["q"])
File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_nlu/model.py", line 340, in parse
component.process(message, **self.context)
File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 172, in process
intents = self.transform_labels_num2str(intent_ids)
File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 108, in transform_labels_num2str
return self.le.inverse_transform(y)
File "/home/ubuntu/.local/lib/python3.5/site-packages/sklearn/preprocessing/label.py", line 273, in inverse_transform
y = column_or_1d(y, warn=True)
File "/home/ubuntu/.local/lib/python3.5/site-packages/sklearn/utils/validation.py", line 797, in column_or_1d
raise ValueError("bad input shape {0}".format(shape))
builtins.ValueError: bad input shape (1, 14)

不知道如何解决?挺着急的。。。

@Ted-Yee
Copy link

Ted-Yee commented May 14, 2019

scikit-learn:0.19.1

@zhangrenjie666666
Copy link

@Ted-Yee 请问你是怎么解决的

@Chenny0808
Copy link

@nihuizhidao scikit-learn 要为0.19.2,我修改sklearn版本后就好了

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

6 participants