Skip to content

Commit 2435c90

Browse files
committed
fix memory
1 parent 73537b4 commit 2435c90

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

js/brainchop/mainMeshNetFunctions.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4762,18 +4762,18 @@ function convByOutputChannelAndInputSlicing(input, filter, biases, stride, pad,
47624762
let timer = window.setInterval(async function() {
47634763

47644764
try {
4765-
// if (res.layers[i].activation.getClassName() !== 'linear') {
4765+
if (res.layers[i].activation.getClassName() !== 'linear') {
47664766
curTensor[i] = res.layers[i].apply( curTensor[i-1]);
4767-
// } else {
4768-
4769-
// curTensor[i] = convByOutputChannelAndInputSlicing(curTensor[i-1],
4770-
// res.layers[i].getWeights()[0],
4771-
// res.layers[i].getWeights()[1],
4772-
// res.layers[i].strides,
4773-
// res.layers[i].padding,
4774-
// res.layers[i].dilationRate,
4775-
// 3); // important for memory use
4776-
// }
4767+
} else {
4768+
4769+
curTensor[i] = convByOutputChannelAndInputSlicing(curTensor[i-1],
4770+
res.layers[i].getWeights()[0],
4771+
res.layers[i].getWeights()[1],
4772+
res.layers[i].strides,
4773+
res.layers[i].padding,
4774+
res.layers[i].dilationRate,
4775+
3); // important for memory use
4776+
}
47774777

47784778

47794779
// // Log memory usage

js/brainchop/mainParameters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
enableCrop: true, // For speed-up inference, crop brain from background before feeding to inference model to lower memory use.
137137
cropPadding: 2, // Padding size add to cropped brain
138138
filterOutWithPreMask: false, // Can be used to multiply final output with premodel output mask to crean noisy areas
139-
enableSeqConv: false, // For low memory system and low configuration, enable sequential convolution instead of last layer
139+
enableSeqConv: true, // For low memory system and low configuration, enable sequential convolution instead of last layer
140140
textureSize: 13585, // Requested Texture size for the model, if unknown can be 0.
141141
warning: "This model may need dedicated graphics card. For more info please check with Browser Resources <i class='fa fa-cogs'></i>.",
142142
inferenceDelay: 100, // Delay in ms time while looping layers applying.

0 commit comments

Comments
 (0)