You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/06/11 09:09:05 UTC

[GitHub] [incubator-tvm] leandron opened a new issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

leandron opened a new issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774


   After #5682, we're now seeing the error below on `test_forward_mediapipe_hand_landmark`. I think that it is not seen on upstream CI because of file caching. As I ran this test, master points at `c7274fd3b0f693fc6214a450e13d5e99026337ae`.
   
   This is the error:
   
   ```
   _____________________ 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:2451: 
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   tests/python/frontend/tflite/test_forward.py:136: in run_tvm_graph
       dtype_dict=dtype_dict)
   python/tvm/relay/frontend/tflite.py:2712: in from_tflite
       op_converter.convert_op_to_relay()
   python/tvm/relay/frontend/tflite.py:185: in convert_op_to_relay
       ret = self.convert_map[op_code_str](op)
   python/tvm/relay/frontend/tflite.py:2454: in convert_dequantize
       in_expr = self.get_expr(input_tensor.tensor_idx)
   python/tvm/relay/frontend/tflite.py:2563: in get_expr
       return self.exp_tab.get_expr(get_tensor_name(self.subgraph, input_tensor_idx))
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   
   self = <tvm.relay.frontend.common.ExprTable object at 0x7f244ac74f28>
   name = 'conv2d/Kernel'
   
       def get_expr(self, name):
   >       return self.exprs[name]
   E       KeyError: 'conv2d/Kernel'
   
   python/tvm/relay/frontend/common.py:294: KeyError
   ----------------------------- Captured stdout call -----------------------------
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] leandron commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
leandron commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-643993004


   I think this is a good workaround.
   
   I'd suggest to use a tag on that repository (rather than a commit hash), to make the URL a bit more meaningful: https://github.com/google/mediapipe/blob/v0.7.4/mediapipe/models/hand_landmark.tflite


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-643995201


   > I think this is a good workaround.
   > 
   > I'd suggest to use a tag on that repository (rather than a commit hash), to make the URL a bit more meaningful: https://github.com/google/mediapipe/blob/v0.7.4/mediapipe/models/hand_landmark.tflite
   
   I think it is nice. @leandron  Could you help to make a pull request to lock it in the tag you mention?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-644696207


   @u99127 Open the issue: https://github.com/apache/incubator-tvm/issues/5823


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene closed issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
FrozenGene closed issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] u99127 commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
u99127 commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-644086991


   Do we also need another issue to indicate that we don't support this kind of quantized networks and tag it as help needed ? 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] leandron commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
leandron commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-643996001


   > I think it is nice. @leandron Could you help to make a pull request to lock it in the tag you mention?
   
   Sure, will do.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-643903889


   This model has been changed rapidly. Previous `hand_landmark.tflite` model is just FP32 model simply. Like this:
   ![image](https://user-images.githubusercontent.com/7287321/84619405-889f6200-af07-11ea-8be9-235e58be14db.png)
   However, current master `hand_landmark.tflite`'s weight is been quantized into FP16. Then it insert `dequantize` to FP32 execution, which is benefit for TFLite GPU execution. like this:
   ![image](https://user-images.githubusercontent.com/7287321/84619486-cb613a00-af07-11ea-89e4-40c71f486334.png)
   
   
   we doesn't support this kind of quantized model yet. I suggest we current lock the `hand_landmark.tflite` into this commit: https://github.com/google/mediapipe/blob/c27a7c1e1064e66427ad0656f776155ab456f90b/mediapipe/models/hand_landmark.tflite
   
   @tqchen @leandron Could you accept this suggestion?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-644184592


   > Do we also need another issue to indicate that we don't support this kind of quantized networks and tag it as help needed ?
   
   I agree.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] tqchen commented on issue #5774: [TFLite] KeyError: 'conv2d/Kernel' on test_forward_mediapipe_hand_landmark()

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5774:
URL: https://github.com/apache/incubator-tvm/issues/5774#issuecomment-643814554


   cc @FrozenGene 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org