Servor error in interactive mode


(Mangouste) #1

I cloned an old chatbot I did from GitHub and wanted to run it. Yet, while using train_online.py I got a ValueError and an HTTPError:

(chaenv36) C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation>python train_online.py
...
Epoch 99/100
113/113 [==============================] - 0s 133us/step - loss: 1.0234 - acc: 0.6018
Epoch 100/100
113/113 [==============================] - 0s 133us/step - loss: 1.0202 - acc: 0.6195
INFO:rasa_core.policies.keras_policy:Done fitting keras policy model
INFO:rasa_core.training.interactive:Rasa Core server is up and running on http://localhost:5005
Bot loaded. Visualisation at http://localhost:5005/visualization.html.
Type a message and press enter (press 'Ctr-c' to exit).
Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 22/22 [00:00<00:00, 628.60it/s, # trackers=1]
? Next user input (Ctr-c to abort):  Hey !
ERROR:rasa_core.server:Caught an exception while logging message.
Traceback (most recent call last):
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\server.py", line 437, in log_message
    tracker = agent.log_message(usermsg)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\agent.py", line 341, in log_message
    return processor.log_message(message)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\processor.py", line 129, in log_message
    self._handle_message_with_tracker(message, tracker)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\processor.py", line 269, in _handle_message_with_tracker
    parse_data = self._parse_message(message)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\processor.py", line 255, in _parse_message
    parse_data = self.interpreter.parse(message.text)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\interpreter.py", line 293, in parse
    return self.interpreter.parse(text)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_nlu\model.py", line 357, in parse
    component.process(message, **self.context)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 180, in process
    intent_ids, probabilities = self.predict(X)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 222, in predict
    pred_result = self.predict_prob(X)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 210, in predict_prob
    return self.clf.predict_proba(X)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\sklearn\utils\metaestimators.py", line 115, in <lambda>
    out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\sklearn\model_selection\_search.py", line 484, in predict_proba
    return self.best_estimator_.predict_proba(X)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\sklearn\svm\base.py", line 594, in _predict_proba
    X = self._validate_for_predict(X)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\sklearn\svm\base.py", line 459, in _validate_for_predict
    (n_features, self.shape_fit_[1]))
ValueError: X.shape[1] = 300 should be equal to 384, the number of features at training time
ERROR:rasa_core.training.interactive:An exception occurred while recording messages.
Traceback (most recent call last):
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\training\interactive.py", line 1257, in record_messages
    _enter_user_message(sender_id, endpoint)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\training\interactive.py", line 1110, in _enter_user_message
    send_message(endpoint, sender_id, answers["message"])
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\training\interactive.py", line 119, in send_message
    return _response_as_json(r)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\training\interactive.py", line 92, in _response_as_json
    response.raise_for_status()
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\requests\models.py", line 940, 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

Googling the last error I read @tmbo answer here:

We have just recently added the NLU training data dumping feature to our master branch. Only if you run that version, the interactive learning will persist collected NLU training data. Because to correct these mistakes, you need to retrain your nlu model.

So I tried to retrain it but I had another error:

(chaenv36) C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation>python train_init.py
...
Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 22/22 [00:00<00:00, 86.66it/s, # trackers=15]
Processed actions: 44it [00:00, 11002.11it/s, # examples=44]
2019-02-09 10:35:08.373081: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
masking (Masking)            (None, 5, 22)             0
_________________________________________________________________
lstm (LSTM)                  (None, 32)                7040
_________________________________________________________________
dense (Dense)                (None, 11)                363
_________________________________________________________________
activation (Activation)      (None, 11)                0
=================================================================
Total params: 7,403
Trainable params: 7,403
Non-trainable params: 0
_________________________________________________________________
INFO:rasa_core.policies.keras_policy:Fitting model with 121 total samples and a validation split of 0.1
Traceback (most recent call last):
  File "train_init.py", line 23, in <module>
    validation_split = 0.2)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\agent.py", line 525, in train
    **kwargs)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\policies\ensemble.py", line 67, in train
    policy.train(training_trackers, domain, **kwargs)
  File "C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\rasa_core\policies\keras_policy.py", line 177, in train
    **params)
TypeError: fit() got multiple values for keyword argument 'epochs'

So I found an answer from @akelad

The correct command that worked for me for online training with the restaurant bot is: python -m rasa_core.train -s data/babi_stories.md -o models/dialogue/ -d restaurant_domain.yml --online

I tried this but it also asked me the config file so I provided it as well and got another error:

(chaenv36) C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation>python -m rasa_core.train -s data/data.md -o models/dialogue/ -d room_domain.yml -c config_spacy.json --online
C:\Users\antoi\Documents\Programming\Nathalie\7_2_2019\ChatbotRASA_Room-reservation\chaenv36\lib\site-packages\h5py\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
usage: train.py [-h] {default,compare,interactive} ...
train.py: error: unrecognized arguments: --online

Environement

Rasa Core version: Version: 0.12.0 Python version: Python 3.6.7 Operating system: windows


(Akela Drissner) #2

It looks like you’re using old code, a lot of things have changed recently, so you may have to update your code to use the newer Rasa versions.


(Mangouste) #3

@akelad Ok, or start again from scratch with the starter-pack-rasa-stack ?