Skip to content

indicator_column raises a TypeError when weighted_categorical_column is used as its input. #12557

Closed

Description

@facaiy

Describe the problem

indicator_column raises a TypeError when weighted_categorical_column is used as its input.

I have fixed the bug, and the PR is coming later.

Source code / logs

    indicator_tensor = _transform_features(features, [indicator])[indicator]
  File "/data1/users/facai/.cache/bazel/_bazel_facai/3338df3cdc4fd0e5fdd3f3ae6490e0be/execroot/tensorflow/bazel-out/local-opt/bin/tensorflow/python/feature_column/feature_column_test.runfiles/org_tensorflow/tensorflow/python/feature_column/feature_column.py", line 377, in _transform_features
    outputs[column] = builder.get(column)
  File "/data1/users/facai/.cache/bazel/_bazel_facai/3338df3cdc4fd0e5fdd3f3ae6490e0be/execroot/tensorflow/bazel-out/local-opt/bin/tensorflow/python/feature_column/feature_column_test.runfiles/org_tensorflow/tensorflow/python/feature_column/feature_column.py", line 1533, in get
    transformed = column._transform_feature(self)  # pylint: disable=protected-access
  File "/data1/users/facai/.cache/bazel/_bazel_facai/3338df3cdc4fd0e5fdd3f3ae6490e0be/execroot/tensorflow/bazel-out/local-opt/bin/tensorflow/python/feature_column/feature_column_test.runfiles/org_tensorflow/tensorflow/python/feature_column/feature_column.py", line 2476, in _transform_feature
    vocab_size=self._variable_shape[-1])
  File "/data1/users/facai/.cache/bazel/_bazel_facai/3338df3cdc4fd0e5fdd3f3ae6490e0be/execroot/tensorflow/bazel-out/local-opt/bin/tensorflow/python/feature_column/feature_column_test.runfiles/org_tensorflow/tensorflow/python/ops/sparse_ops.py", line 1140, in sparse_merge
    type(vocab_size))
TypeError: vocab_size has to be a Tensor or Python int. Found <class 'tensorflow.python.framework.tensor_shape.Dimension'>

Activity

  1. andydavis1 commented on Aug 24, 2017

    @andydavis1
    Contributor

    @000drax Can you take a look and maybe review the PR?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions