Skip to content

[TFLite] test_forward_mediapipe_hand_landmark() test fails due to non-supported 'DEQUANTIZE' operator in TFLite frontend #5682

@leandron

Description

@leandron

With the latest update to the hand_landmark.tflite network (publicly announced here), it is causing test_forward_mediapipe_hand_landmark() test to fail with tvm.error.OpNotImplemented: The following operators are not supported in frontend TFLite: 'DEQUANTIZE'.

I guess we don't see it on CI because the old version of this file is probably cached on the machine. Running tests from scratch (without cached files) will make the issue reproduce.

This is the error we see:

 =================================== FAILURES ===================================
 _____________________ test_forward_mediapipe_hand_landmark _____________________
 
     def test_forward_mediapipe_hand_landmark():
         """Test MediaPipe 2D hand landmark TF Lite model."""
         # MediaPipe 2D hand landmark TF
         tflite_model_file = download_testdata(
             "https://github.com/google/mediapipe/raw/master/mediapipe/models/hand_landmark.tflite",
             "hand_landmark.tflite")
         with open(tflite_model_file, "rb") as f:
             tflite_model_buf = f.read()
         data = np.random.uniform(size=(1, 256, 256, 3)).astype('float32')
         tflite_output = run_tflite_graph(tflite_model_buf, data)
 >       tvm_output = run_tvm_graph(tflite_model_buf, data, 'input_1', num_output=2)
 
 tests/python/frontend/tflite/test_forward.py:2220: 
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 tests/python/frontend/tflite/test_forward.py:110: in run_tvm_graph
     dtype_dict=dtype_dict)
 python/tvm/relay/frontend/tflite.py:2606: in from_tflite
     op_converter.check_unsupported_ops()
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 
 self = <tvm.relay.frontend.tflite.OperatorConverter object at 0x7fd4703a2fd0>
 
     def check_unsupported_ops(self):
         """Check unsupported TFLite ops in our converter."""
         unsupported_ops_set = set()
     
         for op_idx in range(self.subgraph.OperatorsLength()):
             op = self.subgraph.Operators(op_idx)
             op_code_str = self.get_op_code_str(op)
             if op_code_str not in self.convert_map:
                 unsupported_ops_set.add(op_code_str)
     
         if unsupported_ops_set:
             msg = 'The following operators are not supported in frontend ' \
                   'TFLite: {}'
             ops = str(list(unsupported_ops_set)).strip('[,]')
 >           raise tvm.error.OpNotImplemented(msg.format(ops))
 E           tvm.error.OpNotImplemented: The following operators are not supported in frontend TFLite: 'DEQUANTIZE'
 
 python/tvm/relay/frontend/tflite.py:165: OpNotImplemented
 ----------------------------- Captured stdout call -----------------------------
 Downloading from url https://github.com/google/mediapipe/raw/master/mediapipe/models/hand_landmark.tflite to /workspace/.tvm_test_data/hand_landmark.tflite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions