You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Message: Not all values are of valid type. Expected `typing.Union[int, float, str, bytes, bool, typing.List[int], typing.List[float], typing.List[str], typing.List[bytes], typing.List[bool]]` but `<class 'numpy.ndarray'>` was passed.
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 singular List[float]. While the error message implied that either should be fine, the client only successfully executes when the dict contains scalar float values.
Expected Results
Based on the error message, I would expect this to work:
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: