I am trying to integrate my custom developed keras policy to predict the system action.
I have written my custom keras policy with my own methods for model_architecture(), train(), predict_action_probabilities(), and to load(). My custom model has trained and when I try to predict the output, it throws me the following error as follows,
> 2019-12-05 16:04:13 ERROR asyncio - Task exception was never retrieved
> future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\run.py:115> exception=TimeoutError()>
> Traceback (most recent call last):
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\run.py", line 119, in run_cmdline_io
> server_url=constants.DEFAULT_SERVER_FORMAT.format(port)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\channels\console.py", line 137, in record_messages
> async for response in bot_responses:
> File "c:\apps\sa2446\lib\site-packages\async_generator\_impl.py", line 366, in step
> return await ANextIter(self._it, start_fn, *args)
> File "c:\apps\sa2446\lib\site-packages\async_generator\_impl.py", line 205, in throw
> return self._invoke(self._it.throw, type, value, traceback)
> File "c:\apps\sa2446\lib\site-packages\async_generator\_impl.py", line 209, in _invoke
> result = fn(*args)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\channels\console.py", line 102, in send_message_receive_stream
> async for line in resp.content:
> File "c:\apps\sa2446\lib\site-packages\aiohttp\streams.py", line 40, in __anext__
> rv = await self.read_func()
> File "c:\apps\sa2446\lib\site-packages\aiohttp\streams.py", line 329, in readline
> await self._wait('readline')
> File "c:\apps\sa2446\lib\site-packages\aiohttp\streams.py", line 297, in _wait
> await waiter
> File "c:\apps\sa2446\lib\site-packages\aiohttp\helpers.py", line 585, in __exit__
> raise asyncio.TimeoutError from None
> concurrent.futures._base.TimeoutError
> 2019-12-05 16:04:13 ERROR asyncio - Task exception was never retrieved
> future: <Task finished coro=<RestInput.on_message_wrapper() done, defined at C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\channels\channel.py:376> exception=TypeError("'>' not supported between instances of 'NoneType' and 'int'")>
> Traceback (most recent call last):
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\channels\channel.py", line 387, in on_message_wrapper
> await on_new_message(message)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\channels\channel.py", line 65, in handler
> await app.agent.handle_message(*args, **kwargs)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\agent.py", line 488, in handle_message
> return await processor.handle_message(message)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\processor.py", line 90, in handle_message
> await self._predict_and_execute_next_action(message, tracker)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\processor.py", line 353, in _predict_and_execute_next_action
> action, policy, confidence = self.predict_next_action(tracker)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\processor.py", line 180, in predict_next_action
> action_confidences, policy = self._get_next_action_probabilities(tracker)
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\processor.py", line 565, in _get_next_action_probabilities
> tracker, self.domain
> File "C:\Users\SA2446\AppData\Roaming\Python\Python37\site-packages\rasa\core\policies\ensemble.py", line 353, in probabilities_using_best_policy
> if (confidence, p.priority) > (max_confidence, best_policy_priority):
> TypeError: '>' not supported between instances of 'NoneType' and 'int'
I have changed entirely the prediction_action_probabilities() method for my requirements.
Could I get help to solve this issue?