JustinaPetr / Weatherbot_Tutorial

275 stars 447 forks source link

issue while running train_online.py #30

Open AbrarAhmedQuresh opened 5 years ago

AbrarAhmedQuresh commented 5 years ago

Hello there, I am getting the following error, when running the train_online.py

abrarahmed@abrarahmed-HP-Notebook:~/Weatherbot_Tutorial-master/Full Code [Latest release of Rasa NLU and Rasa Core]$ python3 train_online.py Traceback (most recent call last): File "train_online.py", line 12, in from rasa_core.train import online ImportError: cannot import name 'online'

What can I do about that?

Thank you

amsolu commented 5 years ago

mmm weird main is working good did you check your rasa_core version? I found tons of changes between versions I am running 0.11.8

Hope this helping you

AbrarAhmedQuresh commented 5 years ago

Thanks mate, i update rasa_core to new version now its working fine.

but, still when i run further it throws me below error

Epoch 200/200 39/39 [==============================] - 0s 153us/step - loss: 0.4046 - acc: 0.8974 INFO:rasa_core.policies.keras_policy:Done fitting keras policy model INFO:rasa_core.training.online:Rasa Core server is up and running on http://localhost:5005 Bot loaded. Type a message and press enter (use '/stop' to exit). 127.0.0.1 - - [2018-10-04 13:34:01] "GET /domain HTTP/1.1" 200 981 0.002144 127.0.0.1 - - [2018-10-04 13:34:01] "GET /conversations/default/tracker?include_events=APPLIED HTTP/1.1" 200 516 0.002570 ? Next user input: hello ERROR:rasa_core.server:Caught an exception while logging message. Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/rasa_core/server.py", line 370, in log_message tracker_state = agent.log_message(usermsg) File "/usr/local/lib/python3.6/dist-packages/rasa_core/agent.py", line 330, in log_message tracker = processor.log_message(message) File "/usr/local/lib/python3.6/dist-packages/rasa_core/processor.py", line 123, in log_message self._handle_message_with_tracker(message, tracker) File "/usr/local/lib/python3.6/dist-packages/rasa_core/processor.py", line 256, in _handle_message_with_tracker parse_data = self._parse_message(message) File "/usr/local/lib/python3.6/dist-packages/rasa_core/processor.py", line 242, in _parse_message parse_data = self.interpreter.parse(message.text) File "/usr/local/lib/python3.6/dist-packages/rasa_core/interpreter.py", line 284, in parse return self.interpreter.parse(text) File "/usr/local/lib/python3.6/dist-packages/rasa_nlu/model.py", line 357, in parse component.process(message, self.context) File "/usr/local/lib/python3.6/dist-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 175, in process intent_ids, probabilities = self.predict(X) File "/usr/local/lib/python3.6/dist-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 217, in predict pred_result = self.predict_prob(X) File "/usr/local/lib/python3.6/dist-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 205, in predict_prob return self.clf.predict_proba(X) File "/usr/lib/python3/dist-packages/sklearn/utils/metaestimators.py", line 115, in out = lambda *args, *kwargs: self.fn(obj, args, kwargs) File "/usr/lib/python3/dist-packages/sklearn/model_selection/_search.py", line 484, in predict_proba return self.bestestimator.predict_proba(X) File "/usr/lib/python3/dist-packages/sklearn/svm/base.py", line 594, in _predict_proba X = self._validate_for_predict(X) File "/usr/lib/python3/dist-packages/sklearn/svm/base.py", line 459, in _validate_for_predict (n_features, self.shapefit[1])) ValueError: X.shape[1] = 300 should be equal to 384, the number of features at training time Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 936, in handle_one_response self.run_application() File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 910, in run_application self.process_result() File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 894, in process_result for data in self.result: File "/usr/local/lib/python3.6/dist-packages/werkzeug/wsgi.py", line 870, in next return self._next() File "/usr/local/lib/python3.6/dist-packages/werkzeug/wrappers.py", line 82, in _iter_encoded for item in iterable: TypeError: 'Response' object is not iterable Thu Oct 4 13:34:16 2018 {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '59480', 'HTTP_HOST': 'localhost:5005', (hidden keys: 23)} failed with TypeError

127.0.0.1 - - [2018-10-04 13:34:16] "POST /conversations/default/messages HTTP/1.1" 500 161 0.006313 ERROR:rasa_core.training.online:An exception occurred while recording messages. Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 857, in record_messages _enter_user_message(sender_id, endpoint, exit_text) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 790, in _enter_user_message send_message(endpoint, sender_id, answers["message"]) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 88, in send_message return _response_as_json(r) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 62, in _response_as_json response.raise_for_status() File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 928, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:5005/conversations/default/messages Exception in thread Thread-7: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 857, in record_messages _enter_user_message(sender_id, endpoint, exit_text) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 790, in _enter_user_message send_message(endpoint, sender_id, answers["message"]) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 88, in send_message return _response_as_json(r) File "/usr/local/lib/python3.6/dist-packages/rasa_core/training/online.py", line 62, in _response_as_json response.raise_for_status() File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 928, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:5005/conversations/default/messages

Thank you

JustinaPetr commented 5 years ago

Hey. Any chance you are running something else on the same port?

AbrarAhmedQuresh commented 5 years ago

Thank you. i was running on the same port .

nuronics commented 5 years ago

File "train_online.py", line 12, in from rasa_core.train import online ImportError: cannot import name 'online'

JustinaPetr commented 5 years ago

@nuronics I suppose you are already using Rasa Core v0.12? I haven't updated the repo for it yet but will do so later today. Name online was removed for the latest version which was released on Sunday :)

itsamit-kumar commented 5 years ago

@nuronics In Rasa Core: 0.12.2
we need to update below two lines (its working for me)

  1. from rasa_core.training import interactive
  2. interactive.run_interactive_learning(agent,data)
JustinaPetr commented 5 years ago

Yes, @itsamit-kumar , you are right :) @nuronics I have just updated the repo so it should be all up to date and working.

dmoonat commented 5 years ago

I am getting different error as below ValueError: X.shape[1] = 300 should be equal to 384, the number of features at training time

To resolve this i have also re-downloaded the language model (as got from stack overflow) but it didn't work