adap / flower

Flower: A Friendly Federated Learning Framework
https://flower.ai
Apache License 2.0
4.92k stars 848 forks source link

fix(framework:skip) Specify keyword `deterministic` in `SerializeToString` method #4163

Closed panh99 closed 2 weeks ago

panh99 commented 3 weeks ago

Motivation

As explained in google protobuf documentation, the SerializeToString method only accept keyword arguments. In some settings, as spotted by Robert and Danny, the following exception will be raised when calling SerializeToString(True), i.e., a positional argument instead of a keyword argument is passed.

TypeError: _AddSerializeToStringMethod.<locals>.SerializeToString() takes 1 positional argument but 2 were given

Solution

Change SerializeToString(True) to SerializeToString(deterministic=True).