From 8a8c795e5fc93403c8c1da11f574794391051327 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 8 May 2024 18:15:20 -0400 Subject: [PATCH] Fix --- structures/Tensorflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structures/Tensorflow.js b/structures/Tensorflow.js index 40b70a02..37c72ea1 100644 --- a/structures/Tensorflow.js +++ b/structures/Tensorflow.js @@ -76,8 +76,8 @@ module.exports = class Tensorflow { const loadedImage = imageTensor.toFloat().div(tf.scalar(255)).expandDims(); imageTensor.dispose(); const styleTensor = tf.node.decodeImage(styleImg, 3); - styleTensor.dispose(); const loadedStyle = styleTensor.toFloat().div(tf.scalar(255)).expandDims(); + styleTensor.dispose(); const stylePrediction = await this.styleModel.predict(loadedStyle); loadedStyle.dispose(); const stylizedImage = await this.transformerModel.predict([loadedImage, stylePrediction.squeeze()]);