Skip to content

TensorFlow 2.12.0 breaks nightly tests. #2154

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

Closed
fatcat-z opened this issue Apr 2, 2023 · 5 comments
Closed

TensorFlow 2.12.0 breaks nightly tests. #2154

fatcat-z opened this issue Apr 2, 2023 · 5 comments
Labels
bug An unexpected problem or unintended behavior

Comments

@fatcat-z
Copy link
Collaborator

fatcat-z commented Apr 2, 2023

self = <test_backend.BackendTests testMethod=test_Conv2DBackpropInput>
tflite_path = '/tmp/tmp9j283eve/test_Conv2DBackpropInput/test_Conv2DBackpropInput.tflite'

def tflite_has_supported_types(self, tflite_path):
    try:
        with open(tflite_path, 'rb') as f:
            buf = f.read()
        buf = bytearray(buf)
        model = Model.GetRootAsModel(buf, 0)
        tensor_cnt = model.Subgraphs(0).TensorsLength()
        interpreter = tf.lite.Interpreter(tflite_path)
        for i in range(tensor_cnt):
          dtype = interpreter._get_tensor_details(i)['dtype']   # pylint: disable=protected-access

E TypeError: Interpreter._get_tensor_details() missing 1 required positional argument: 'subgraph_index'

@fatcat-z fatcat-z added the bug An unexpected problem or unintended behavior label Apr 2, 2023
@pranavladkat
Copy link

Is there an ETA for this issue?

@q-ycong-p
Copy link
Contributor

+1 on this issue. Any update on a fix?

q-ycong-p referenced this issue in tensorflow/tensorflow Jul 12, 2023
…put_details.

This will correctly return tensor information for tensor ids in each subgraph.

PiperOrigin-RevId: 494047935
@q-ycong-p
Copy link
Contributor

q-ycong-p commented Jul 12, 2023

I put up a naive workaround #2204, just to start discussion towards a fix. Welcome more thoughtful fix, especially if folks have deeper knowledge on this tflite's change wrt subgraph at tf-2.12, and tf2onnx's corresponding path forward.

[UPDATE]
Updated PR to directly use TFLite Interpreter's public API instead. I am not seeing an obvious advantage of using the private API. Pls point out if I'm missing anything there! Ty.

@q-ycong-p
Copy link
Contributor

Hi @fatcat-z, all tests passed after re-opening #2204 - which aims to address this issue. Would appreciate a feedback/review from maintainers. Thank you!

@yan12125
Copy link
Contributor

This issue can probably be closed as #2204 is merged?

@fatcat-z fatcat-z closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants