Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX. #296

Open
EldadWinter opened this issue Jan 6, 2024 · 5 comments

Comments

@EldadWinter
Copy link

When trying to do this:
media_scaler = preprocessing.CustomScaler(divide_operation=jnp.mean)
target_scaler = preprocessing.CustomScaler(divide_operation=jnp.mean)
cost_scaler = preprocessing.CustomScaler(divide_operation=jnp.mean)

media_data_train = media_scaler.fit_transform(media_data_train)
target_train = target_scaler.fit_transform(target_train)
costs2 = cost_scaler.fit_transform(costs)

I got the error. up until then everything went as in the tutorial.

@entzyeung
Copy link

have you transformed your dataframe or dataset to array, e.g. with np.array(media_data_train)?

@EldadWinter
Copy link
Author

I did like this, on the tutorial. it is an array but still doesn't let me use the Scalers:

Screenshot 2024-01-08 at 16 39 27

@entzyeung
Copy link

it is an array, and is float32, it should be in good shape already. WHich dataset threw an error? target? media? or others?

@EldadWinter
Copy link
Author

EldadWinter commented Jan 8, 2024

As you can see below the target_train caused errors. The Scalers & fit_transofrm of media_data_train and costs worked.

Screenshot 2024-01-08 at 19 12 25

And this is how target_train looks like:

Screenshot 2024-01-08 at 19 15 21

@entzyeung
Copy link

entzyeung commented Jan 9, 2024

Hmmmm.... I know you have checked it already, but would there be any chance that your target_train has nan, null, zero, or different data dtype?

Do you mind to provide your notebook, and data for further investigation? I am not sure if there is any pm function in github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants