-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Keras 3 Featurespace running into error when using PyTorch backed #19317
Comments
Hi, Basically this error is happening due to the map function, where you're trying to pass symbolic You can modify the logiic by converting |
@sachinprasadhs Do you mean converting tf.data to numpy iterator using
|
Thank you for the new code. I am including it below for reference.
The solution seems to require iterating through the entire tf.data dataset and load it into memory. This may be impractical if the dataset is very large. In my actual application, I am streaming from disk using |
AFAIK, symbolic |
Hi @sibyjackgrove, you cannot use a non-TF featurespace in To keep using the PyTorch backend, you can use a TorchDataLoader or a Keras PyDataset. |
It is unfortunate that such a useful feature like Keras FeatureSpace doesn't have multi-backed support. I couldn't find anything in the documentation to suggest that Keras FeatureSpace doesn't work with PyTorch backend. I think this should be made explicit so that users don't utilize FeatureSpace thinking that it is mult-backend. |
As suggested in the above comment, you can use it with like below using torch backend.
or you can use |
@sachinprasadhs Could you please share an example for using Keras |
I am trying to use Keras 3 FeatureSpace on a tf.data dataset. It works fine with the tensorflow backend.
However, I am encountering the below error when I try to run the below example using a Pytorch backed : https://keras.io/examples/structured_data/structured_data_classification_with_feature_space/
The only change I am doing is changing the backend to Pytorch using: os.environ["KERAS_BACKEND"] = "torch"
The error is occurring at the line where the feature space is mapped to the dataset.
The text was updated successfully, but these errors were encountered: