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

scale_to_z_score_per_key does not work with SparseTensors and key_vocabulary_filename is not None #250

Open
cyc opened this issue Oct 26, 2021 · 0 comments

Comments

@cyc
Copy link

cyc commented Oct 26, 2021

If you try to run tft.scale_to_z_score_per_key while passing in SparseTensors for x and key, while also setting key_vocabulary_filename to a value other than None, you will get an error message like:

TypeError: Expected string, got <tensorflow.python.framework.sparse_tensor.SparseTensor object at 0x1a7d5e9a0> of type 'SparseTensor' instead.

This exception ultimately originates from here:

https://github.com/tensorflow/transform/blob/v1.3.0/tensorflow_transform/tf_utils.py#L649

The root cause is that key is a SparseTensor instead of a regular Tensor (key.values needs to be passed in instead of key)

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

No branches or pull requests

4 participants