Skip to content

tf.raw_ops.LookupTableExportV2 aborts process on dtype mismatch instead of raising InvalidArgumentError #125503

Closed

Description

@TTZTTZ1

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

No

Source

binary

TensorFlow version

tf2.21.0

Custom code

Yes

OS platform and distribution

Linux Ubuntu 22.04.5 LTS

Mobile device

N/A

Python version

3.10.20

Bazel version

N/A

GCC/compiler version

N/A

CUDA/cuDNN version

CUDA 13.0.88 cuDNN 9.x

GPU model and memory

NVIDIA GeForce RTX 5090 32G

Current behavior?

tf.raw_ops.LookupTableExportV2 aborts the process when exporting a table with incompatible key/value dtypes.

A StaticHashTable initialized with int64 keys and values is exported while requesting string keys and values. This triggers a fatal internal check failure:

Check failed: dtype() == expected_dtype (7 vs. 9)
*** Check failure stack trace: ***
Aborted

Expected behavior:

TensorFlow should validate the requested key/value dtypes against the actual table dtypes and raise a framework-level exception such as InvalidArgumentError instead of terminating the process.

Standalone code to reproduce the issue

import tensorflow as tf

table = tf.lookup.StaticHashTable(
    tf.lookup.KeyValueTensorInitializer(
        tf.constant([0], dtype=tf.int64),
        tf.constant([1], dtype=tf.int64),
    ),
    default_value=-1,
)

tf.raw_ops.LookupTableExportV2(
    table_handle=table.resource_handle,
    Tkeys=tf.string,
    Tvalues=tf.string,
)

Relevant log output

Check failed: dtype() == expected_dtype (7 vs. 9)
*** Check failure stack trace: ***
Aborted

Activity

  1. added
    comp:ops
    2.21.0
    on Aug 18, 2026
  2. Kayyuri commented on Sep 3, 2026

    @Kayyuri

    Hi @TTZTTZ1, Thank you for raising your concern here.
    A fix for this issue has been proposed in this PR. Once it is merged, this issue will be resolved.

    Many thanks to @adi-IL for raising the PR to address this issue. We truly appreciate your initiative and the effort in contributing the fix.

  3. google-ml-butler commented on Sep 25, 2026

    @google-ml-butler

    Are you satisfied with the resolution of your issue?
    Yes
    No

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

Metadata

Metadata

Assignees

Labels

2.21.0awaiting PR mergecomp:opstype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions