# Internal Server Error while running interactive learning

**URL:** <https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678>\
**Category:** Rasa Open Source\
**Created:** [December 18, 2018, 3:19pm UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678 "2018-12-18T15:19:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arunkumar0258](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunkumar0258/32/1268_2.png) [@Arunkumar0258](https://forum.rasa.com/u/Arunkumar0258)\
**Post date:** [December 18, 2018, 3:19pm UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/1 "2018-12-18T15:19:06Z")

</div>

I was trying to do interactive learning through Python Script in rasa\_core. Currently I have version 0.12.3 of rasa\_core.

The interactive learning starts fine, but after I enter a message and the intent is correctly identified, but after pressing Enter, it shows the following error:

? Is the NLU classification for ‘hey’ with intent ‘greet’ correct? Yes 2018-12-18 20:38:44 ERROR rasa\_core.server - Caught an exception during prediction. Traceback (most recent call last): File “/usr/local/lib/python3.5/dist-packages/rasa\_core/server.py”, line 410, in predict responses = agent.predict\_next(sender\_id) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/agent.py”, line 329, in predict\_next return processor.predict\_next(sender\_id) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/processor.py”, line 107, in predict\_next self.\_get\_next\_action\_probabilities(tracker) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/processor.py”, line 478, in \_get\_next\_action\_probabilities tracker, self.domain) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/policies/ensemble.py”, line 291, in probabilities\_using\_best\_policy if (result.index(max\_confidence) == AttributeError: ‘NoneType’ object has no attribute ‘index’ 2018-12-18 20:38:44 ERROR rasa\_core.training.interactive - An exception occurred while recording messages. Traceback (most recent call last): File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 1286, in record\_messages finetune, sender\_ids, plot\_file) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 853, in \_predict\_till\_next\_listen response = request\_prediction(endpoint, sender\_id) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 135, in request\_prediction return \_response\_as\_json® File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 98, in \_response\_as\_json response.raise\_for\_status() File “/usr/local/lib/python3.5/dist-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/05c6cc83d799492ab82dad1031e062f4/predict](http://localhost:5005/conversations/05c6cc83d799492ab82dad1031e062f4/predict) Exception in thread Thread-5: Traceback (most recent call last): File “/usr/lib/python3.5/threading.py”, line 914, in \_bootstrap\_inner self.run() File “/usr/lib/python3.5/threading.py”, line 862, in run self.\_target(\*self.\_args, \*\*self.\_kwargs) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 1286, in record\_messages finetune, sender\_ids, plot\_file) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 853, in \_predict\_till\_next\_listen response = request\_prediction(endpoint, sender\_id) File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 135, in request\_prediction return \_response\_as\_json® File “/usr/local/lib/python3.5/dist-packages/rasa\_core/training/interactive.py”, line 98, in \_response\_as\_json response.raise\_for\_status() File “/usr/local/lib/python3.5/dist-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/05c6cc83d799492ab82dad1031e062f4/predict](http://localhost:5005/conversations/05c6cc83d799492ab82dad1031e062f4/predict)

I have included my train\_online.py code in the following link: [https://pastebin.com/bD12P187](https://pastebin.com/bD12P187)

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [December 19, 2018, 6:20am UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/2 "2018-12-19T06:20:35Z")

</div>

Hi Arun! check out my online.py file. I had same issue at one point. Resolved it by adding future absolute import and other files. Try creating a file by matching my file. leave policy if you want to use default values.[online.py](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/faef9f1da0e02f61fe7c41a33661602dbe421488.py) (1.3 KB)

---

<div class="post-metadata">

**Author:** ![Arunkumar0258](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunkumar0258/32/1268_2.png) [@Arunkumar0258](https://forum.rasa.com/u/Arunkumar0258)\
**Post date:** [December 19, 2018, 6:40am UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/3 "2018-12-19T06:40:27Z")

</div>

Thanks a lot Akshit. It works!!

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [December 19, 2018, 6:51am UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/4 "2018-12-19T06:51:41Z")

</div>

happy to help! #GoRasa xD

---

<div class="post-metadata">

**Author:** ![Sayak9495](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sayak9495/32/1323_2.png) [@Sayak9495](https://forum.rasa.com/u/Sayak9495)\
**Post date:** [December 19, 2018, 7:41am UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/5 "2018-12-19T07:41:16Z")

</div>

Hi. I’m having same kind of problem(different error though).I’m using Rasa Core 0.12 and Rasa nlu 0.13 (the latest version)

Rasa Core giving this error - `Exception: BinarySingleStateFeaturizer was not prepared before encoding.`

 ![Screenshot%20from%202018-12-17%2015-49-32](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/b/ba1f00eed303fd1539d15d8cb5d81500721a61ba.png)

Any idea how to solve it?

---

<div class="post-metadata">

**Author:** ![justin](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/justin/32/10562_2.png) [@justin](https://forum.rasa.com/u/justin)\
**Post date:** [January 10, 2019, 8:18pm UTC](https://forum.rasa.com/t/internal-server-error-while-running-interactive-learning/3678/6 "2019-01-10T20:18:10Z")

</div>

i got this error as i was not training the agent before running interative learning.

just have a look below 🙂data = agent.load\_data(training\_data\_file) agent.train(data) Itrain.run\_interactive\_learning(agent,stories=training\_data\_file,skip\_visualization = True)
