https://flyte.org logo
#ask-the-community
Title
# ask-the-community
s

Smriti Satyan

09/05/2022, 9:46 AM
Hi @yousef ahmed, welcome to Flyte. The error above suggests that you have a different data type passed to your code, i.e a numpy float value, but it instead expected a float value. Today, we don't support for numpy float values, hence an easy but not-so-efficient way would be to convert your numpy float values to floats. But remember this isn't the recommended way of doing things. We have numpy float support coming up soon!
y

yousef ahmed

09/05/2022, 9:49 AM
fine, I'm new with Flyte. So, I followed the tutorial and this issue comes up!
s

Smriti Satyan

09/05/2022, 9:49 AM
Happy to help. Feel free to jump in for clarifications.
s

Samhita Alla

09/05/2022, 10:04 AM
Which tutorial is it, @yousef ahmed?
c

Claudio Andres Gauna

09/05/2022, 3:22 PM
@yousef ahmed could you please change the notebook at the end
Copy code
from flytekitplugins.papermill import record_outputs
record_outputs(mae_score=mae_score)
Copy code
from flytekitplugins.papermill import record_outputs
record_outputs(mae_score=float(mae_score)ç)
Just to try
y

yousef ahmed

09/05/2022, 3:28 PM
I tried this but didn't work, worked with me in other place "I think was notebook.py" but here not worked, in the end solved by help @Samhita Alla replace 'return mean(score) in cross_validate function to float(np.mean(score)).
c

Claudio Andres Gauna

09/05/2022, 4:25 PM
Yeah this is ok
s

Smriti Satyan

09/05/2022, 4:29 PM
@yousef ahmed Exactly. You have converted the return type of mean(score) from being a numpy.float to a floating point type. I'm glad it worked!
y

yousef ahmed

09/05/2022, 4:33 PM
yeah that worked for two notebooks also (supermarket_regression, supermarket_regression_2)
74 Views