Hi, I finally ran out of excuses to learn ML and Tensorflow.js, I’m building my first model and came across an error that I don’t quite understand where is coming from.
I have a basic model that takes an image and calculates a certain value, the input layer is a cropping layer that removes a number of pixels from the top and bottom of the image. The model works well, but when I change the settings of the cropping layer, say, remove 25 pixels from the top instead of 75, the browser (chrome) flickers and outputs the following error:
NOTE: Right before the above error, it prints out the following message *Couldn't parse line number in error*
followed by what appears to be GLSL code.
The same happens if I remove the cropping layer altogether.
I’m using tfjs v3.8.0 but also tested with v2.0.0 with similar outcomes. This is my model:
const model = tf.sequential();
// Cropping Layer
model.add(
tf.layers.cropping2D({
// If I change 75 to anything below 50, it crashes before completing the first epoch,
// If this layer is removed, it crashes almost immediately after training starts
cropping: [
[75, 25],
[0, 0]
],
// image height, width, depth
inputShape: [160, 320, 3]
})
);
model.add(
tf.layers.conv2d({
filters: 16,
kernelSize: [3, 3],
strides: [2, 2],
activation: 'relu',
})
);
model.add(
tf.layers.maxPool2d({
poolSize: [2, 2]
})
);
model.add(
tf.layers.conv2d({
filters: 32,
kernelSize: [3, 3],
strides: [2, 2],
activation: 'relu'
})
);
model.add(
tf.layers.maxPool2d({
poolSize: [2, 2]
})
);
model.add( tf.layers.flatten());
model.add( tf.layers.dense({ units: 1024, activation: 'relu' }));
model.add( tf.layers.dropout({ rate: 0.25 }));
model.add( tf.layers.dense({ units: 128, activation: 'relu' }));
model.add( tf.layers.dense({ units: 1, activation: 'linear' }));
model.compile({
optimizer: 'adam',
loss: 'meanSquaredError',
metrics: [
'accuracy',
],
});
Am I doing something obviously wrong?
Thanks.