Add Support for BilinearUpSampling2D Layer for Keras model
See original GitHub issueTo get help from the community, check out our Google group.
TensorFlow.js version
0.11.6
Browser version
Version 67.0.3396.62 (Official Build) (64-bit)
Describe the problem or feature request
When I import my model in tfjs, I get the error:
Error: Unknown layer: BilinearUpSampling2D
Code to reproduce the bug / link to feature request
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
tf.keras.layers.UpSampling2D | TensorFlow v2.11.0
Upsampling layer for 2D inputs. ... out sessions from the WiML Symposium covering diffusion models with KerasCV, on-device ML, and more.
Read more >Keras Network: Placeholder for 'BilinearUpSampling2D'
Hello, I'm trying to use a keras network for depth estimation from a monocular view. I'm following this: https://www.mathworks.com/help ...
Read more >Making new layers and models via subclassing - Keras
Description: Complete guide to writing Layer and Model objects from scratch. ... you can add non-trainable weights to a layer as well.
Read more >Keras layers API
Keras layers API. Layers are the basic building blocks of neural networks in Keras. A layer consists of a tensor-in tensor-out computation function...
Read more >Layer activation functions - Keras
Activations can either be used through an Activation layer, or through the activation argument supported by all forward layers: model.add(layers.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
BilinearUpSampling2D is not an official layer in Keras.
Here’s are two implementations I found:
Interestingly, neither of them set
align_corners=True
. From my read of issues like https://github.com/tensorflow/tensorflow/issues/6720 it’s an open question whether the default behavior is desired or not going forward. Another description of this “bug” is provided here https://hackernoon.com/how-tensorflows-tf-image-resize-stole-60-days-of-my-life-aba5eb093f35The right place to get this function added first would be Keras. That said, if you can convert your model from Keras to straight Tensorflow, then it looks like tfjs already supports bilinear resizing via https://js.tensorflow.org/api/0.11.6/#image.resizeBilinear
Closing the issue as the layer is still not a standard layer in Keras. Users can implement the custom layer. See example at https://codepen.io/caisq/pen/jdBgwB