当另一个循环正在运行时,不能运行事件循环。

问题描述 投票:0回答:1

RuntimeError: 不能在另一个循环运行时运行事件循环。

试图在我的本地设置tensorflow_federated。所有的导入版本都是正确的。

CUDA = 10.1,

python = 3.6.9,

tensorflow = 2.2.0,

tf_federated = latest

这个错误不是发生在谷歌Colab。但是,发生在我的本地机器上,当我试图做任何联合计算。我得到的是运行时错误。RuntimeError: 无法在另一个循环运行时运行事件循环。

RuntimeError                              Traceback (most recent call last)
<ipython-input-5-9c097e9baec9> in <module>
----> 1 tff.federated_computation(lambda: 'hi')()

~\AppData\Local\Continuum\anaconda3\envs\tflocal\lib\asyncio\base_events.py in run_forever(self)
    426         if events._get_running_loop() is not None:
    427             raise RuntimeError(
--> 428                 'Cannot run the event loop while another loop is running')
    429         self._set_coroutine_wrapper(self._debug)
    430         self._thread_id = threading.get_ident()

RuntimeError: Cannot run the event loop while another loop is running
tensorflow tensorflow2.0 tensorflow-serving tensorflow-federated
1个回答
0
投票

尝试删除 import nest-asyncio

© www.soinside.com 2019 - 2024. All rights reserved.