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

Slightly friendlier import warning. #18425

Open
koaning opened this issue Aug 1, 2023 · 3 comments
Open

Slightly friendlier import warning. #18425

koaning opened this issue Aug 1, 2023 · 3 comments
Assignees
Labels
stat:awaiting keras-eng Awaiting response from Keras engineer type:feature The user is asking for a new feature.

Comments

@koaning
Copy link

koaning commented Aug 1, 2023

I initially tried the new keras core with keras_nlp via this code:

import os
os.environ["KERAS_BACKEND"] = "jax"

import keras_nlp

It gave a long trace telling me that "jax" was not installed. Fair enough, so I ran pip install jax and restarted the env. After re-running, it complained that I had to install jaxlib instead.

This is a nit in the grand scheme of things, but it would be nicer if the trace was caught and gave me the correct pip install command. Alternatively, it might also be nice if it told me to python -m pip install keras[jax] so that Keras can handle the jax install on my behalf.

Again, this is a nit, but might improve the developer experience when folks want to give the new Keras Core stuff a spin.

@fchollet
Copy link
Member

fchollet commented Aug 1, 2023

Thanks for the report -- this is a good idea.

@fchollet
Copy link
Member

fchollet commented Aug 3, 2023

One complication is that some packages requite a different installation process based on whether you're using GPU or not, and based on your CUDA version.

@fchollet
Copy link
Member

fchollet commented Aug 3, 2023

We could pick the CUDA version that is compatible with at least one version of each backend and then provide a shell script that installs the right thing (in a way that is mutually compatible) for a given backend, e.g. jax-gpu. We can then point users to this script / command when they hit an ImportError message.

@sachinprasadhs sachinprasadhs added type:feature The user is asking for a new feature. stat:awaiting keras-eng Awaiting response from Keras engineer labels Sep 5, 2023
@fchollet fchollet transferred this issue from keras-team/keras-core Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting keras-eng Awaiting response from Keras engineer type:feature The user is asking for a new feature.
4 participants