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

Improve error message of RaggedTensor by showing data type explicitly #34130

Merged

Conversation

yongtang
Copy link
Member

While working on writing a tf.data pipeline with RaggedTensor the following
error showed up:


    def raise_from(value, from_value):
>       raise value
E       InvalidArgumentError: Expected splits Tensor dtype: 9, found: 3 [Op:RaggedTensorFromVariant]

/usr/local/lib/python2.7/dist-packages/six.py:737: InvalidArgumentError

It is not very obvious about the exact type that needs. Until found out in
tensorflow/core/framework/types.proto that 3 is int32 and 9 is int64.

This PR enhance the error message by explictily print out the DataType in string,
so the message will be:

E       InvalidArgumentError: Expected splits Tensor dtype: int64, found: int32 [Op:RaggedTensorFromVariant]

Signed-off-by: Yong Tang yong.tang.github@outlook.com

While working on writing a tf.data pipeline with RaggedTensor the following
error showed up:
```

    def raise_from(value, from_value):
>       raise value
E       InvalidArgumentError: Expected splits Tensor dtype: 9, found: 3 [Op:RaggedTensorFromVariant]

/usr/local/lib/python2.7/dist-packages/six.py:737: InvalidArgumentError
```

It is not very obvious about the exact type that needs. Until found out in
`tensorflow/core/framework/types.proto` that `3` is `int32` and `9` is `int64`.

This PR enhance the error message by explictily print out the DataType in string,
so the message will be:
```
E       InvalidArgumentError: Expected splits Tensor dtype: int64, found: int32 [Op:RaggedTensorFromVariant]
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@tensorflow-bot tensorflow-bot bot added the size:XS CL Change Size: Extra Small label Nov 10, 2019
@gbaned gbaned self-assigned this Nov 11, 2019
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Nov 11, 2019
@gbaned gbaned added the awaiting review Pull request awaiting review label Nov 15, 2019
@gbaned gbaned requested a review from robieta November 21, 2019 12:37
@gbaned gbaned requested a review from ezhulenev January 8, 2020 11:32
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jan 8, 2020
@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jan 8, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jan 8, 2020
@gbaned gbaned removed the awaiting review Pull request awaiting review label Jan 9, 2020
tensorflow-copybara pushed a commit that referenced this pull request Jan 9, 2020
PiperOrigin-RevId: 288932302
Change-Id: Ib37fb307289f848be851533540ca801899be5c29
@tensorflow-copybara tensorflow-copybara merged commit 428d176 into tensorflow:master Jan 9, 2020
PR Queue automation moved this from Approved by Reviewer to Merged Jan 9, 2020
@yongtang yongtang deleted the ragged-tensor-error-message branch January 9, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:XS CL Change Size: Extra Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants