我有以下代码:
import grpc
ip_address = ['0.0.0.0'] * n_workers #@param {type:"string"}
ports = [80+i for i in range(n_workers)] #@param {type:list["integer"]}
channels = [grpc.insecure_channel(f'{ip_address[i]}:{ports[i]}') for i in range(len(ports))]
tff.backends.native.set_remote_python_execution_context(channels)
当我运行这部分代码时,我收到此错误:
AttributeError: module 'tensorflow_federated.python.core.backends.native' has no attribute 'set_remote_python_execution_context'
我知道
set_remote_python_execution_context
已被弃用,
但我该如何解决这个问题?
我尝试根据
cpp
已发布的注释使用 tff
执行,但没有一个与 set_remote_python_execution_context
完全相同。