Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D
See original GitHub issueTo 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
- You can reproduce by saving the Xception application model into a h5 keras model using model.save.
- Convert the model into tfjs_layer_models as describe by tensorflowjs_converter website
- 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:
- Created 4 years ago
- Comments:8
Top 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 >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
Should this be closed? This is still an issue now. Is there an update on the progress of this bug?
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.