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.

Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D

See original GitHub issue

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

1.2.3

Browser version

Node 10.15

Describe the problem or feature request

When loading in a converted layer model, I get the following error message: Error: Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead. The model was a variation of Xception. It contains many SeparableConv2D layer and a few of them uses kernal_initializer. It appeared that the tfjs version think those fields are invalid.

Code to reproduce the bug / link to feature request

  1. You can reproduce by saving the Xception application model into a h5 keras model using model.save.
  2. Convert the model into tfjs_layer_models as describe by tensorflowjs_converter website
  3. Load it back in using tfjs const tf = require("@tensorflow/tfjs"); const tfn = require("@tensorflow/tfjs-node"); const handler = tfn.io.fileSystem("./layer_model/model.json"); const model = await tf.loadLayersModel(handler);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
ghostcommented, Oct 23, 2020

Should this be closed? This is still an issue now. Is there an update on the progress of this bug?

2reactions
jerrydengcommented, Jul 22, 2019

The underlying implementation of Xception is directly from tf.keras.applications with no change to any ContNet. If the use of the attributes are invalid, then the Xception implementation in tf.keras should be fixed as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.keras.layers.SeparableConv2D | TensorFlow
Class SeparableConv2D. Aliases: ... SeparableConv2D; Class tf.keras.layers. ... ValueError : if the layer's call method returns None (an invalid value).
Read more >
Tensorflow.js tf.layers.separableConv2d() Function
args: It accepts objects as parameters with the following fields: ... kernelInitializer: It is the initializer for the convolution kernel weight matrix.
Read more >
Creates a tf.Tensor with the provided values, shape and dtype.
Tensor of target data, or an Array of tf.Tensors if the model has multiple outputs. args (Object) A ModelEvaluateConfig , containing optional fields....
Read more >
What does layer.get_weights() of a Separable convolutional ...
SeparableConv2D layer is computing the depthwise separable convolution which, unlike normal convolution, requires 2 kernels (2 weight ...
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