BrokenPipeError: [WinError 232] The pipe is being closed while running dialogue management model

BrokenPipeError: [WinError 232] The pipe is being closed while running dialogue management model

it is my code from future import absolute_import from future import division from future import print_function from future import unicode_literals

import logging import rasa_core from rasa_core.agent import Agent from rasa_core.policies.keras_policy import KerasPolicy from rasa_core.policies.memoization import MemoizationPolicy from rasa_core.interpreter import RasaNLUInterpreter from rasa_core.utils import EndpointConfig from rasa_core.run import serve_application from rasa_core import config

logger = logging.getLogger(name)

def train_dialogue(domain_file = ‘doctor_domain.yml’, model_path = ‘./models/dialogue’, training_data_file = ‘./data/stories.md’):

agent = Agent(domain_file, policies = [MemoizationPolicy(), KerasPolicy(max_history=3, epochs=200, batch_size=50)])
data = agent.load_data(training_data_file)	


agent.train(data)
			
agent.persist(model_path)
return agent

def run_doctor_bot(serve_forever=True): interpreter = RasaNLUInterpreter(’./models/nlu/default/doctornlu’) action_endpoint = EndpointConfig(url=“http://localhost:5055/webhook”) agent = Agent.load(’./models/dialogue’, interpreter=interpreter, action_endpoint=action_endpoint) rasa_core.run.serve_application(agent ,channel=‘cmdline’)

return agent

if name == ‘main’: train_dialogue() run_doctor_bot() ###########################3 this is my error Epoch 112/200 43/43 [==============================] - 0s 233us/step - loss: 1.1599 - acc: 0.5 116 Epoch 113/200 43/43 [==============================] - 0s 233us/step - loss: 1.1751 - acc: 0.5 116 Epoch 114/200 43/43 [==============================] - 0s 209us/step - loss: 1.2024 - acc: 0.5 116 Epoch 115/200 43/43 [==============================] - 0s 210us/step - loss: 1.1871 - acc: 0.5 116 Epoch 116/200 43/43 [==============================] - 0s 233us/step - loss: 1.1756 - acc: 0.5 116 Epoch 117/200 43/43 [==============================] - 0s 210us/step - loss: 1.1406 - acc: 0.5 116 Epoch 118/200 43/43 [==============================] - 0s 209us/step - loss: 1.1403 - acc: 0.5 116 Epoch 119/200 43/43 [==============================] - 0s 232us/step - loss: 1.1591 - acc: 0.5 116 Epoch 120/200 43/43 [==============================] - 0s 208us/step - loss: 1.1414 - acc: 0.5 116 Epoch 121/200 43/43 [==============================] - 0s 233us/step - loss: 1.1231 - acc: 0.5 116 Epoch 122/200 43/43 [==============================] - 0s 233us/step - loss: 1.1212 - acc: 0.5 116 Epoch 123/200 43/43 [==============================] - 0s 256us/step - loss: 1.1004 - acc: 0.5 349 Epoch 124/200 43/43 [==============================] - 0s 233us/step - loss: 1.0703 - acc: 0.5 349 Epoch 125/200 43/43 [==============================] - 0s 256us/step - loss: 1.1257 - acc: 0.5 116 Epoch 126/200 43/43 [==============================] - 0s 233us/step - loss: 1.0877 - acc: 0.5 349 Epoch 127/200 43/43 [==============================] - 0s 233us/step - loss: 1.0834 - acc: 0.5 116 Epoch 128/200 43/43 [==============================] - 0s 209us/step - loss: 1.0510 - acc: 0.5 814 Epoch 129/200 43/43 [==============================] - 0s 210us/step - loss: 1.0611 - acc: 0.5 814 Epoch 130/200 43/43 [==============================] - 0s 210us/step - loss: 1.0876 - acc: 0.5 581 Epoch 131/200 43/43 [==============================] - 0s 209us/step - loss: 1.0601 - acc: 0.5 814 Epoch 132/200 43/43 [==============================] - 0s 210us/step - loss: 1.0445 - acc: 0.5 581 Epoch 133/200 43/43 [==============================] - 0s 208us/step - loss: 1.0262 - acc: 0.5 814 Epoch 134/200 43/43 [==============================] - 0s 211us/step - loss: 1.0178 - acc: 0.6 279 Epoch 135/200 43/43 [==============================] - 0s 209us/step - loss: 1.0011 - acc: 0.5 814 Epoch 136/200 43/43 [==============================] - 0s 209us/step - loss: 0.9960 - acc: 0.5 814 Epoch 137/200 43/43 [==============================] - 0s 210us/step - loss: 0.9807 - acc: 0.6 279 Epoch 138/200 43/43 [==============================] - 0s 209us/step - loss: 1.0292 - acc: 0.5 814 Epoch 139/200 43/43 [==============================] - 0s 211us/step - loss: 0.9543 - acc: 0.6 512 Epoch 140/200 43/43 [==============================] - 0s 218us/step - loss: 0.9955 - acc: 0.6 279 Epoch 141/200 43/43 [==============================] - 0s 223us/step - loss: 0.9652 - acc: 0.6 744 Epoch 142/200 43/43 [==============================] - 0s 209us/step - loss: 0.9655 - acc: 0.6 047 Epoch 143/200 43/43 [==============================] - 0s 210us/step - loss: 0.9794 - acc: 0.6 047 Epoch 144/200 43/43 [==============================] - 0s 218us/step - loss: 0.9294 - acc: 0.6 512 Epoch 145/200 43/43 [==============================] - 0s 210us/step - loss: 0.8876 - acc: 0.7 442 Epoch 146/200 43/43 [==============================] - 0s 210us/step - loss: 0.8982 - acc: 0.6 977 Epoch 147/200 43/43 [==============================] - 0s 212us/step - loss: 0.8855 - acc: 0.7 209 Epoch 148/200 43/43 [==============================] - 0s 210us/step - loss: 0.9508 - acc: 0.5 581 Epoch 149/200 43/43 [==============================] - 0s 209us/step - loss: 0.8990 - acc: 0.6 744 Epoch 150/200 43/43 [==============================] - 0s 233us/step - loss: 0.8848 - acc: 0.6 977 Epoch 151/200 43/43 [==============================] - 0s 210us/step - loss: 0.8755 - acc: 0.6 744 Epoch 152/200 43/43 [==============================] - 0s 210us/step - loss: 0.8624 - acc: 0.6 279 Epoch 153/200 43/43 [==============================] - 0s 209us/step - loss: 0.8432 - acc: 0.6 977 Epoch 154/200 43/43 [==============================] - 0s 233us/step - loss: 0.8457 - acc: 0.6 977 Epoch 155/200 43/43 [==============================] - 0s 212us/step - loss: 0.8657 - acc: 0.7 209 Epoch 156/200 43/43 [==============================] - 0s 209us/step - loss: 0.8154 - acc: 0.7 442 Epoch 157/200 43/43 [==============================] - 0s 209us/step - loss: 0.8235 - acc: 0.7 442 Epoch 158/200 43/43 [==============================] - 0s 209us/step - loss: 0.7945 - acc: 0.7 209 Epoch 159/200 43/43 [==============================] - 0s 233us/step - loss: 0.7994 - acc: 0.7 674 Epoch 160/200 43/43 [==============================] - 0s 232us/step - loss: 0.8087 - acc: 0.6 512 Epoch 161/200 43/43 [==============================] - 0s 233us/step - loss: 0.8080 - acc: 0.7 442 Epoch 162/200 43/43 [==============================] - 0s 210us/step - loss: 0.8612 - acc: 0.7 442 Epoch 163/200 43/43 [==============================] - 0s 209us/step - loss: 0.7993 - acc: 0.6 512 Epoch 164/200 43/43 [==============================] - 0s 233us/step - loss: 0.7855 - acc: 0.7 674 Epoch 165/200 43/43 [==============================] - 0s 233us/step - loss: 0.7821 - acc: 0.6 977 Epoch 166/200 43/43 [==============================] - 0s 233us/step - loss: 0.7466 - acc: 0.8 140 Epoch 167/200 43/43 [==============================] - 0s 231us/step - loss: 0.8157 - acc: 0.7 209 Epoch 168/200 43/43 [==============================] - 0s 210us/step - loss: 0.7527 - acc: 0.7 907 Epoch 169/200 43/43 [==============================] - 0s 210us/step - loss: 0.7594 - acc: 0.8 140 Epoch 170/200 43/43 [==============================] - 0s 233us/step - loss: 0.7913 - acc: 0.6 977 Epoch 171/200 43/43 [==============================] - 0s 210us/step - loss: 0.7347 - acc: 0.7 907 Epoch 172/200 43/43 [==============================] - 0s 233us/step - loss: 0.7381 - acc: 0.7 674 Epoch 173/200 43/43 [==============================] - 0s 233us/step - loss: 0.7477 - acc: 0.7 442 Epoch 174/200 43/43 [==============================] - 0s 185us/step - loss: 0.7084 - acc: 0.8 140 Epoch 175/200 43/43 [==============================] - 0s 233us/step - loss: 0.7428 - acc: 0.7 907 Epoch 176/200 43/43 [==============================] - 0s 208us/step - loss: 0.6789 - acc: 0.9 070 Epoch 177/200 43/43 [==============================] - 0s 210us/step - loss: 0.6803 - acc: 0.8 372 Epoch 178/200 43/43 [==============================] - 0s 210us/step - loss: 0.6741 - acc: 0.8 372 Epoch 179/200 43/43 [==============================] - 0s 210us/step - loss: 0.7581 - acc: 0.7 209 Epoch 180/200 43/43 [==============================] - 0s 233us/step - loss: 0.6451 - acc: 0.8 605 Epoch 181/200 43/43 [==============================] - 0s 185us/step - loss: 0.6433 - acc: 0.7 907 Epoch 182/200 43/43 [==============================] - 0s 233us/step - loss: 0.7262 - acc: 0.7 442 Epoch 183/200 43/43 [==============================] - 0s 233us/step - loss: 0.6381 - acc: 0.9 070 Epoch 184/200 43/43 [==============================] - 0s 211us/step - loss: 0.6959 - acc: 0.8 140 Epoch 185/200 43/43 [==============================] - 0s 210us/step - loss: 0.6692 - acc: 0.8 372 Epoch 186/200 43/43 [==============================] - 0s 210us/step - loss: 0.6298 - acc: 0.7 907 Epoch 187/200 43/43 [==============================] - 0s 199us/step - loss: 0.6422 - acc: 0.8 605 Epoch 188/200 43/43 [==============================] - 0s 210us/step - loss: 0.5996 - acc: 0.8 605 Epoch 189/200 43/43 [==============================] - 0s 210us/step - loss: 0.6462 - acc: 0.7 907 Epoch 190/200 43/43 [==============================] - 0s 208us/step - loss: 0.5788 - acc: 0.9 767 Epoch 191/200 43/43 [==============================] - 0s 210us/step - loss: 0.6232 - acc: 0.8 605 Epoch 192/200 43/43 [==============================] - 0s 233us/step - loss: 0.5739 - acc: 0.8 837 Epoch 193/200 43/43 [==============================] - 0s 210us/step - loss: 0.5452 - acc: 0.9 302 Epoch 194/200 43/43 [==============================] - 0s 209us/step - loss: 0.5750 - acc: 0.9 302 Epoch 195/200 43/43 [==============================] - 0s 233us/step - loss: 0.5406 - acc: 0.9 535 Epoch 196/200 43/43 [==============================] - 0s 185us/step - loss: 0.6104 - acc: 0.8 605 Epoch 197/200 43/43 [==============================] - 0s 209us/step - loss: 0.5790 - acc: 0.9 302 Epoch 198/200 43/43 [==============================] - 0s 210us/step - loss: 0.5513 - acc: 0.9 535 Epoch 199/200 43/43 [==============================] - 0s 185us/step - loss: 0.5499 - acc: 0.9 070 Epoch 200/200 43/43 [==============================] - 0s 210us/step - loss: 0.5924 - acc: 0.8 605 D:\Anaconda3\lib\site-packages\rasa_nlu\extractors\entity_synonyms.py:85: UserWa rning: Failed to load synonyms file from ‘./models/nlu/default/doctornlu\entity_ synonyms.json’ “”.format(entity_synonyms_file)) Bot loaded. Type a message and press enter (use ‘/stop’ to exit): hi 127.0.0.1 - - [2019-03-24 13:30:50] “POST /webhooks/rest/webhook?stream=true&tok en= HTTP/1.1” 200 219 0.574447 Exception in thread Thread-7: Traceback (most recent call last): File “D:\Anaconda3\lib\threading.py”, line 916, in _bootstrap_inner self.run() File “D:\Anaconda3\lib\threading.py”, line 864, in run self._target(*self._args, **self._kwargs) File “D:\Anaconda3\lib\site-packages\rasa_core\channels\console.py”, line 116, in record_messages for response in bot_responses: File “D:\Anaconda3\lib\site-packages\rasa_core\channels\console.py”, line 73, in send_message_receive_stream stream=True) as r: AttributeError: enter

Traceback (most recent call last): File “D:\Anaconda3\lib\multiprocessing\queues.py”, line 236, in _feed send_bytes(obj) File “D:\Anaconda3\lib\multiprocessing\connection.py”, line 200, in send_bytes

self._send_bytes(m[offset:offset + size])

File “D:\Anaconda3\lib\multiprocessing\connection.py”, line 280, in _send_byte s ov, err = _winapi.WriteFile(self._handle, buf, overlapped=True) BrokenPipeError: [WinError 232] The pipe is being closed

Hi @mukesh0290, are you able to train and run your bot in the command line interface? Are you running your python script via the commandline or a jupyter notebook (or something of the sort)? This looks like an I/O error.

Thank you , Issue solved