TensorFlow-Unreal icon indicating copy to clipboard operation
TensorFlow-Unreal copied to clipboard

RuntimeError: got Future <Future pending> attached to a different loop

Open Digletto opened this issue 2 years ago • 2 comments

When running remote server using the latest release (default requirements installed only), I run into this error when sending inputs. Here's the full error message:

Task exception was never retrieved future: <Task finished coro=<AsyncServer._handle_event_internal() done, defined at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:506> exception=RuntimeError('Task <Task pending coro=<AsyncServer._handle_event_internal() running at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:508>> got Future <Future pending> attached to a different loop')> Traceback (most recent call last): File "C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py", line 508, in _handle_event_internal r = await server._trigger_event(data[0], namespace, sid, *data[1:]) File "C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py", line 542, in _trigger_event ret = await handler(*args) File "server.py", line 91, in send_input return await future RuntimeError: Task <Task pending coro=<AsyncServer._handle_event_internal() running at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:508>> got Future <Future pending> attached to a different loop

I think the line should be 88, I've just added some logging for debugging. I can avoid the error if I update the stored loop after connecting with g.sio_loop = asyncio.get_running_loop(). But then the input result events never show up in unreal.

Digletto avatar Jun 23 '22 07:06 Digletto

Eventually got it to work by running g.sio_loop = asyncio.get_running_loop() whenever sendInput is called. Not sure if this slows everything down though.

Digletto avatar Jun 23 '22 12:06 Digletto

fixed in https://github.com/getnamo/ml-remote-server/commit/5941fe2e131bdee052109374f705bed60d9a6059

getnamo avatar Nov 17 '22 00:11 getnamo