You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tf.raw_ops.ExtractImagePatches: Assertion failure in shape inference step #63067
2024-02-27 20:05:58.701202: F ./tensorflow/core/framework/shape_inference.h:891] Check failed: val >= 0 || val == InferenceContext::kUnknownDim Dimension must be non-negative or equal to InferenceContext::kUnknownDim but got -2
Aborted (core dumped)
In release build, we can observe unstable intermediate tensor with invalid dim(gist).
importtensorflowastftf.compat.v1.disable_eager_execution()
x=tf.raw_ops.ExtractImagePatches(
images=tf.random.normal([1,1,1,1]),
ksizes=[1,-1,2,1],
strides=[1,1,1,1],
rates=[1,1,1,1],
padding="VALID",
name=None
)
# Prints "True"print(tf.is_tensor(x))
# Ends up with "ValueError: Dimension -2 must be >= 0"print(x)
I think this behaviour exists if negative values passed to strides and rates also. Validation might be costly in that case.Since this behaviour is specific to a debug build and official builds won't have this behaviour, could you please mention the build command used for this build. May be there exists a nice way for fixing this.
Hi @Sehun0819,
Thank you so much for filing this issue! We truly appreciate your support. At the moment, this request is not prioritized and mark it for community contributions. If you would like to contribute on a fix, please feel free to fork the repository and submit a pull request in accordance with the TensorFlow CONTRIBUTION GUIDELINES and link this issue in your PR to ensure the maintainers can easily review and collaborate.
To avoid duplicate work, please leave a comment here if you decide to take it on!
Thank you again for your interest and we look forward to seeing your contributions!
Activity
Sehun0819 commentedon Feb 27, 2024
In release build, we can observe unstable intermediate tensor with invalid dim(gist).
SuryanarayanaY commentedon Feb 27, 2024
Hi @Sehun0819 ,
I think this behaviour exists if negative values passed to strides and rates also. Validation might be costly in that case.Since this behaviour is specific to a debug build and official builds won't have this behaviour, could you please mention the build command used for this build. May be there exists a nice way for fixing this.
Thanks!
Sehun0819 commentedon Feb 27, 2024
@SuryanarayanaY
Hi!
I built it following manual with
--config=dbg.I just found that it runs without any error message when both
ksizes[1]andksizes[2]are negative(gist), and it seems even worse.SuryanarayanaY commentedon Mar 1, 2024
Hi @Sehun0819 ,
The DCHECK pointed here already addresses in PR #63089. I believe the API still lacks some validations.
Kayyuri commentedon Jun 3, 2026
Hi @Sehun0819,
Thank you so much for filing this issue! We truly appreciate your support. At the moment, this request is not prioritized and mark it for community contributions. If you would like to contribute on a fix, please feel free to fork the repository and submit a pull request in accordance with the TensorFlow CONTRIBUTION GUIDELINES and link this issue in your PR to ensure the maintainers can easily review and collaborate.
To avoid duplicate work, please leave a comment here if you decide to take it on!
Thank you again for your interest and we look forward to seeing your contributions!
2 remaining items
google-ml-butler commentedon Oct 7, 2026
Are you satisfied with the resolution of your issue?
Yes
No
Validate spatial attributes in ExtractImagePatches shape inference