-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Why use custom op Convolution2DTransposeBias in palm_detection.tflite? #245
Comments
@apivovarov I see their CPU implmentation. (Done in cpu_op_resolver) But I cannot find their GPU implementation. If you look at https://github.com/google/mediapipe/blob/731d2b95363d58f12acb29a6f8435ec33fe548d9/mediapipe/util/tflite/op_resolver.cc#L48, no functions are actually being registered to the custom op. |
The GPU implementation is here A fused op such as this is more efficient on GPU than running two ops sequentially, and has identical result as the split version (tconv + add). The models are built with GPU use case as priority, and are back-ported to support CPU via a custom op. |
@mcclanahoochie Thank you very much. That makes a lot of sense. Just a question. That seems like open gl implementation and not metal. So will that work on iOS? Another question if you can help me with this. I am trying to build a C++ static framework for iOS, so that I can add the custom ops. I am not using the C API, so cannot use the TensorflowLiteC/Swift/Objc pods. There is a TensorflowLite pod, but that is version 1.3, not 2. I can't find the bazel build file which generates the TensorflowLite pod, which has the C++ headers in them. |
We converted Model visualization palm_detection_builtin.tflite.html |
Can this model be used for multi hand detection? |
We are closing this issue for now due to lack of activity. |
Hi, how could you change ops in tflite model? |
download schema
convert to json
edit json
I recommend to visualize tflite model to get tensor ids and buffer ids
Convert edited json to tflite
|
Thank you!! |
Could you please share the files again? It's perfect if you share the edited JSON file. Thank you very much. |
Is there any possibility to make a tflite model use those optimized ops when I convert from a regular keras model? |
…_ios_face_landmarker Refactor ios FacelLandmarker
I'm not sure why mediapipe uses custom op
Convolution2DTransposeBias
inpalm_detection.tflite
.Can it be replaced with built-In ops
TRANSPOSE_CONV
andADD
?TRANSPOSE_CONV
op was added to TFLite in version 1.9I tried to create Keras model with
Conv2DTranspose
layer and I setuse_bias=True
andbias_initializer='random_uniform'
.https://keras.io/layers/convolutional/#conv2dtranspose
That Keras model can be converted to TFLite model. Keras
Conv2DTranspose
op was mapped to two built-in TFLite operatorsTRANSPOSE_CONV
andADD
Resulting TFLite model visualization: (download html and open it): https://www.dropbox.com/s/au39pvmw3fquhm1/conv2d_transpose_bias.tflite.htm?dl=0
The text was updated successfully, but these errors were encountered: