Open 1-bite-only opened 4 years ago
@Merlin-Zeng can you please provide reproduction code or an example in codepen.
@rthadur here you go
const tf = require("@tensorflow/tfjs-node");
const model = tf.sequential({
layers: [
tf.layers.conv2d({filters: 1, kernelSize: 3, padding: 'same', inputShape: [15,15,3]}),
tf.layers.batchNormalization({epsilon: 1e-5, axis: 3, center: true, scale: false}),
],
});
model.compile({
optimizer: 'adam',
loss: 'meanSquaredError',
metrics: 'accuracy',
});
model.fit(tf.ones([1,15,15,3]), tf.ones([1,15,15,1])).then(console.log);
Same thing seems to happen when specifying { center: false }
Epoch 1 / 10
(node:5784) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'read' of undefined
at node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:14682:85
at node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:3075:22
at Engine.scopedRun (node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:3085:23)
at Engine.tidy (node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:3074:21)
at Object.tidy (node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:15138:19)
at BatchNormalization.call (node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:14654:20)
at node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:3370:36
at nameScope (node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:931:19)
at BatchNormalization.Layer.apply (node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:3334:16)
at execute (node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:6031:45)
Hi @1-bite-only ,
Apology for the late response. I've reproduced the issue with the latest version of @tensorflow/tfjs@4.4.0
and i am getting the same error.
Find the below attached screenshots.
Code:
Error:
CC: @pyu10055 Do you have any update on this issue? Thank you !
Any update on this?
TensorFlow.js version
tfjs-node: 1.5.2
Browser version
Describe the problem
After replace '_this.gamma.read()' with '_this.gamma == null ? null : _this.gamma.read()' in normalization.js:240, will get following error:
Code to reproduce the bug
Add batch normalization layer with following config and train will reproduce the issue: