Skip to content

Fix NullPointerException issue. #407

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

Merged
merged 1 commit into from
Jan 14, 2022
Merged

Conversation

frankfliu
Copy link
Contributor

@frankfliu frankfliu commented Jan 13, 2022

This fixes #406, With this fix, it will throw a TFInvalidArgumentException instead of NullPointerException.

The error message looks like the following:

org.tensorflow.exceptions.TFInvalidArgumentException: padding_value must be a scalar
Encountered when executing an operation using EagerExecutor. This error cancels all future operations and poisons their output tensors.

Before the fix, the stacktrace is quite confusing:

java.lang.NullPointerException
at org.tensorflow.EagerOperation.resolveTensorHandle(EagerOperation.java:193)
at org.tensorflow.EagerOperation.resolveTensor(EagerOperation.java:166)
at org.tensorflow.EagerOperation.tensor(EagerOperation.java:152)
at org.tensorflow.Output.asTensor(Output.java:97)
at org.tensorflow.Operand.asTensor(Operand.java:65)

Copy link
Collaborator

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Craigacp
Copy link
Collaborator

Craigacp commented Jan 13, 2022

Could you put an example of the error message before & after as a Github comment here in case we've got this mistake elsewhere so we can find it with search.

@frankfliu
Copy link
Contributor Author

Could you put an example of the error message before & after as a Github comment here in case we've got this mistake elsewhere so we can find it with search.

I updated the description

@karllessard
Copy link
Collaborator

Thanks @frankfliu !

@karllessard karllessard merged commit 1f69192 into tensorflow:master Jan 14, 2022
Craigacp pushed a commit to Craigacp/tensorflow-java that referenced this pull request Mar 10, 2022
@Craigacp Craigacp mentioned this pull request Mar 13, 2022
karllessard pushed a commit that referenced this pull request Mar 26, 2022
* Bumping version for point release.

* Fix NullPointerException issue. (#407)

* Bumping to TF 2.7.1, protobuf 3.19.4, error-prone 2.10.0 (#412)

* Fix metric test failures (#414)

* Migrate metric tests from randomUniform to statelessRandomUniform


Co-authored-by: Frank Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException when calling matrixDiagV3
3 participants