crownpku / Rasa_NLU_Chi

Turn Chinese natural language into structured data 中文自然语言理解
Apache License 2.0
1.51k stars 422 forks source link

ERROR __main__ - bad input shape (1, 5) #89

Open shicl opened 5 years ago

shicl commented 5 years ago

2019-05-10 17:00:11+0800 [-] No Jieba Default Dictionary found 2019-05-10 17:00:11+0800 [-] No Jieba User Dictionary found 2019-05-10 17:00:14+0800 [-] Building prefix dict from the default dictionary .. . 2019-05-10 17:00:14+0800 [-] Loading model from cache C:\Users\ADMINI~1\AppData\ Local\Temp\jieba.cache 2019-05-10 17:00:15+0800 [-] Loading model cost 1.646 seconds. 2019-05-10 17:00:15+0800 [-] Prefix dict has been built succesfully. 2019-05-10 17:00:15+0800 [-] 2019-05-10 17:00:15 ERROR main - bad input shape (1, 5) 2019-05-10 17:00:15+0800 [-] Traceback (most recent call last): 2019-05-10 17:00:15+0800 [-] File "D:\Rasa_NLU_Chi\rasa_nlu\server.py", line 2 39, in parse 2019-05-10 17:00:15+0800 [-] else threads.deferToThread(self.data_router.par se, data)) 2019-05-10 17:00:15+0800 [-] File "D:\ProgramData\Anaconda3.5\lib\site-package s\twisted\python\threadpool.py", line 250, in inContext 2019-05-10 17:00:15+0800 [-] result = inContext.theWork() 2019-05-10 17:00:15+0800 [-] File "D:\ProgramData\Anaconda3.5\lib\site-package s\twisted\python\threadpool.py", line 266, in 2019-05-10 17:00:15+0800 [-] inContext.theWork = lambda: context.call(ctx, f unc, *args, **kw)

Rasa NLU version 0.12.2:

Operating system windows:

Content of model configuration file: language: "zh"

pipeline:

Issue:

ilham-bintang commented 5 years ago

Same issue

hongtw commented 5 years ago

Same issue

AlucardNosferatu commented 4 years ago

Same issue

AlucardNosferatu commented 4 years ago

Server CMD:

C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi>python -m rasa_nlu.server -c sample_configs/config_jieba_mitie.yml --path models :0: UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''. Please install it from https://pypi.python.org/pypi/service_identity and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected. 2019-11-30 17:44:47 WARNING py.warnings - C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\utils__init__.py:236: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. return yaml.load(read_file(filename, "utf-8"))

2019-11-30 17:44:47+0800 [-] Log opened. 2019-11-30 17:44:47+0800 [-] Site starting on 5000 2019-11-30 17:44:47+0800 [-] Starting factory <twisted.web.server.Site object at 0x000001F3307EB2B0> 2019-11-30 17:44:52.203952: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2019-11-30 17:44:52.208159: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2019-11-30 17:44:56+0800 [-] No Jieba Default Dictionary found 2019-11-30 17:44:56+0800 [-] No Jieba User Dictionary found 2019-11-30 17:44:56+0800 [-] Building prefix dict from the default dictionary ... 2019-11-30 17:44:56+0800 [-] Loading model from cache C:\Users\16413\AppData\Local\Temp\jieba.cache 2019-11-30 17:44:57+0800 [-] Loading model cost 0.561 seconds. 2019-11-30 17:44:57+0800 [-] Prefix dict has been built succesfully. 2019-11-30 17:44:57+0800 [-] 2019-11-30 17:44:57 ERROR main - bad input shape (1, 5) 2019-11-30 17:44:57+0800 [-] Traceback (most recent call last): 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\server.py", line 239, in parse 2019-11-30 17:44:57+0800 [-] else threads.deferToThread(self.data_router.parse, data)) 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\twisted\python\threadpool.py", line 250, in inContext 2019-11-30 17:44:57+0800 [-] result = inContext.theWork() 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\twisted\python\threadpool.py", line 266, in 2019-11-30 17:44:57+0800 [-] inContext.theWork = lambda: context.call(ctx, func, *args, kw) 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\twisted\python\context.py", line 122, in callWithContext 2019-11-30 17:44:57+0800 [-] return self.currentContext().callWithContext(ctx, func, *args, *kw) 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\twisted\python\context.py", line 85, in callWithContext 2019-11-30 17:44:57+0800 [-] return func(args,kw) 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\data_router.py", line 242, in parse 2019-11-30 17:44:57+0800 [-] model) 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\project.py", line 123, in parse 2019-11-30 17:44:57+0800 [-] response = self._models[model_name].parse(text, time) 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\model.py", line 340, in parse 2019-11-30 17:44:57+0800 [-] component.process(message, **self.context) 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 172, in process 2019-11-30 17:44:57+0800 [-] intents = self.transform_labels_num2str(intent_ids) 2019-11-30 17:44:57+0800 [-] File "C:\Users\16413\Documents\GitHub\Rasa_NLU_Chi\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 108, in transform_labels_num2str 2019-11-30 17:44:57+0800 [-] return self.le.inverse_transform(y) 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\preprocessing\label.py", line 273, in inverse_transform 2019-11-30 17:44:57+0800 [-] y = column_or_1d(y, warn=True) 2019-11-30 17:44:57+0800 [-] File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 797, in column_or_1d 2019-11-30 17:44:57+0800 [-] raise ValueError("bad input shape {0}".format(shape)) 2019-11-30 17:44:57+0800 [-] ValueError: bad input shape (1, 5) 2019-11-30 17:44:57+0800 [-] "127.0.0.1" - - [30/Nov/2019:09:44:57 +0000] "GET /parse?q=%E6%88%91%E5%8F%91%E7%83%A7%E4%BA%86&project=default&model=model_20191130-170456 HTTP/1.1" 500 39 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" 2019-11-30 17:45:52+0800 [-] Timing out client: IPv4Address(type='TCP', host='127.0.0.1', port=13639)

AlucardNosferatu commented 4 years ago

POST: http://127.0.0.1:5000/parse JSON: {"q":"我发烧了该吃什么药?", "project": "default", "model": "model_20191130-170456"}

RESPONSE: { "error": "bad input shape (1, 5)" }

WavesLi commented 4 years ago

@AlucardNosferatu @hongtw @nullphantom Have you resolved this question?

WavesLi commented 4 years ago

@AlucardNosferatu @hongtw @nullphantom When I changed the version of scikit-learn to scikit-learn==0.19.0, the issue was resolved, and if you have resolved the issue like this please close the issuse

AlucardNosferatu commented 4 years ago

@AlucardNosferatu @hongtw @nullphantom When I changed the version of scikit-learn to scikit-learn==0.19.0, the issue was resolved, and if you have resolved the issue like this please close the issuse

ok, I'll have a try

c123853648 commented 4 years ago

@AlucardNosferatu @hongtw @nullphantom When I changed the version of scikit-learn to scikit-learn==0.19.0, the issue was resolved, and if you have resolved the issue like this please close the issuse

if change scikit-learn==0.19.0.I get this error

2020-02-26 15:54:38+0800 [-] 2020-02-26 15:54:38 ERROR main - Can't get attribute 'DeprecationDict' on <module 'sklearn.utils.deprecation' from 'D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\sklearn\utils\deprecation.py'> 2020-02-26 15:54:38+0800 [-] Traceback (most recent call last): 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\server.py", line 240, in parse 2020-02-26 15:54:38+0800 [-] else threads.deferToThread(self.data_router.parse, data)) 2020-02-26 15:54:38+0800 [-] File "D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\twisted\python\threadpool.py", line 250, in inContext 2020-02-26 15:54:38+0800 [-] result = inContext.theWork() 2020-02-26 15:54:38+0800 [-] File "D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\twisted\python\threadpool.py", line 266, in 2020-02-26 15:54:38+0800 [-] inContext.theWork = lambda: context.call(ctx, func, *args, kw) 2020-02-26 15:54:38+0800 [-] File "D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\twisted\python\context.py", line 122, in callWithContext 2020-02-26 15:54:38+0800 [-] return self.currentContext().callWithContext(ctx, func, *args, *kw) 2020-02-26 15:54:38+0800 [-] File "D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\twisted\python\context.py", line 85, in callWithContext 2020-02-26 15:54:38+0800 [-] return func(args,kw) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\data_router.py", line 242, in parse 2020-02-26 15:54:38+0800 [-] model) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\project.py", line 118, in parse 2020-02-26 15:54:38+0800 [-] interpreter = self._interpreter_for_model(model_name) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\project.py", line 196, in _interpreter_for_model 2020-02-26 15:54:38+0800 [-] return Interpreter.create(metadata, self._component_builder) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\model.py", line 303, in create 2020-02-26 15:54:38+0800 [-] model_metadata, context) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\components.py", line 398, in load_component 2020-02-26 15:54:38+0800 [-] cached_component, context) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\registry.py", line 130, in load_component_by_name 2020-02-26 15:54:38+0800 [-] return component_clz.load(model_dir, metadata, cached_component, **kwargs) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 233, in load 2020-02-26 15:54:38+0800 [-] return utils.pycloud_unpickle(classifier_file) 2020-02-26 15:54:38+0800 [-] File "D:\e\2020\AIMP\Rasa\Rasa_NLU_Chi-master\rasa_nlu\utils__init__.py", line 322, in pycloud_unpickle 2020-02-26 15:54:38+0800 [-] return cloudpickle.load(f, encoding="latin-1") 2020-02-26 15:54:38+0800 [-] AttributeError: Can't get attribute 'DeprecationDict' on <module 'sklearn.utils.deprecation' from 'D:\ProgramData\Anaconda3\envs\py36\lib\site-packages\sklearn\utils\deprecation.py'>