Why are my convolutional layers not providing expected output using TensorFlowJS?

I’m using a CNN with TensorFlowJS to classify images and show the output of the conv2d layers. Visualising the conv2d layer output works well in python. However, in JS the output is the same as the input image except that it is slightly darker. For some reason the convolution isn’t functioning properly. Any ideas why?
”’

// Get first 2 convolutional layers
const conv2d_0 = model2.getLayer(index = 1);
const conv2d_1 = model2.getLayer(index = 2);

// Convert detected face image into tensor
var image_tensor = tf.browser.fromPixels(cropped_face);

// Resize image to be of requirered resolution
image_tensor = tf.image.resizeBilinear(image_tensor,[48,48]);

// Average depth channel to create gray scale image
image_tensor = tf.mean(image_tensor,axis = 2);

// Normalize values between 0-1
image_tensor = normalize(image_tensor);

// Expand tensor dimensions to fit CNN
image_tensor = tf.expandDims(image_tensor,0);
image_tensor = tf.expandDims(image_tensor,3);

// Apply first 2 conv2d layers to image tensor
var output1 = conv2d_0.apply(image_tensor);
var output2 = conv2d_1.apply(output1);

// Turn tensor into array
var array = nj.array(output2.arraySync());

// Slice array, resulting array of shape (1,46,46,1)
var sliced = array.slice(null,null,null,[44,null,45]);

//Turn Array back into tensor
var sliced_tensor = tf.tensor(sliced.reshape(46,46).tolist());

// Display output of first 2 layers as an image
tf.browser.toPixels(sliced_tensor,canvasBottom);

”’