AttributeError: module 'tensorflow_federated.python.core.backends.native' has no attribute 'set_remote_python_execution_context'

33 Views Asked by At

I have the following code:

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)

when I run this part of code I got this error:

AttributeError: module 'tensorflow_federated.python.core.backends.native' has no attribute 'set_remote_python_execution_context'

I know set_remote_python_execution_context is deprecated, but how can I fix this?

I tried to use cpp executions based on tff released-notes, but none of them didn't exactly same as set_remote_python_execution_context.

1

There are 1 best solutions below

0
Zachary Garrett On

It looks like this API was removed in the 0.50.0 release back in 2023-02-23.

To find out what version is installed, use:

pip show tensorflow-federated

To use a version before 0.50.0, use:

pip install --force-reinstall "tensorflow-federated==0.49.0"