question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Support for BilinearUpSampling2D Layer for Keras model

See original GitHub issue

To 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:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kylemcdonaldcommented, Jun 17, 2018

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-aba5eb093f35

The 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

0reactions
caisqcommented, Feb 12, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found