Type issue with dict returned by client fit function #3951
Labels
bug
Something isn't working
part: misc framework
Issue/PR for general applications for Flower framework.
stale
If issue/PR hasn't been updated within 3 weeks.
Describe the bug
I believe there is a type issue with the client
fit
function returns. In particular, the third return is a dict which contains metrics that will be passed to the server. The dict has limits on which types of variables can be values, and an error is thrown when the wrong type is included in the dict (such as ndarray). However, a list is indicated as an allowed value in the error message, but the client script fails when there is a list value in the dict.Steps/Code to Reproduce
For example, using
sklearn
, I attempted to return a metrics dict of the following format:and received this error message:
This indicates that ndarrays are not a valid format, which is fine. However, upon converting this to a list, the client function fails without an error message. Specifically, I modified the above to:
As indicated in the error message,
List[float]
is a valid return type, and no error message was created after this update. However, the client function fails and the server does not receive the model updates.Further, if the list is broken up into scalar values there is no issue.
With this change, the dict contains several
float
values, rather than a singularList[float]
. While the error message implied that either should be fine, the client only successfully executes when the dict contains scalarfloat
values.Expected Results
Based on the error message, I would expect this to work:
Actual Results
There is no error message, but all client scripts end in failure.
The text was updated successfully, but these errors were encountered: