Can anybody help me to replace this function? I am getting error for these code:
tff.learning.assign_weights_to_keras_model(eval_model, state.model)
The
tff.learning.assign_weights_to_keras_model
function has been removed from the new version of TensorFlow Federated.
The solution depends on which TFF version you are using. One replacement is:
Try replacing
tff.learning.assign_weights_to_keras_model(eval_model, state.model)
with
state.model.assign_weights_to(eval_model)
2nd replacement is(latest version):
Try replacing
tff.learning.assign_weights_to_keras_model(eval_model, state.model)
with
tff.learning.models.ModelWeights.assign_weights_to(