@@ -4141,8 +4141,7 @@ class SequentialConvLayer {
4141
4141
// Important to avoid "undefined" class var members inside the timer.
4142
4142
// "this" has another meaning inside the timer.
4143
4143
4144
- // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
4145
- //document.getElementById("progressBarChild").parentElement.style.visibility = "visible";
4144
+ document . getElementById ( "progressBarChild" ) . parentElement . style . visibility = "visible" ;
4146
4145
4147
4146
return new Promise ( ( resolve , reject ) => {
4148
4147
@@ -4184,32 +4183,27 @@ class SequentialConvLayer {
4184
4183
} ) ;
4185
4184
4186
4185
// -- await showMemStatus(chIdx, self.outChannels);
4187
- // Log memory usage
4188
- const memoryInfo = tf . memory ( ) ;
4189
- console . log ( `Iteration ${ chIdx } :` ) ;
4190
- console . log ( `Number of Tensors: ${ memoryInfo . numTensors } ` ) ;
4191
- console . log ( `Number of Data Buffers: ${ memoryInfo . numDataBuffers } ` ) ;
4192
- console . log ( `Bytes In Use: ${ memoryInfo . numBytes } ` ) ;
4193
- console . log ( `Megabytes In Use: ${ ( memoryInfo . numBytes / 1048576 ) . toFixed ( 3 ) } MB` ) ;
4194
- console . log ( `Unreliable: ${ memoryInfo . unreliable } ` ) ;
4186
+
4195
4187
// Assign the new values to outC and outB
4196
4188
outC = result [ 0 ] ;
4197
4189
outB = result [ 1 ] ;
4198
4190
4199
4191
if ( chIdx == ( self . outChannels - 1 ) ) {
4200
4192
4201
4193
window . clearInterval ( seqTimer ) ;
4202
- // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
4203
- // document.getElementById("progressBarChild").style.width = 0 + "%";
4194
+ document . getElementById ( "progressBarChild" ) . style . width = 0 + "%" ;
4204
4195
tf . dispose ( outB ) ;
4205
4196
const endTime = performance . now ( ) ;
4206
4197
const executionTime = endTime - startTime ;
4207
4198
console . log ( `Execution time for output layer: ${ executionTime } milliseconds` ) ;
4208
4199
resolve ( outC ) ;
4200
+ } else {
4201
+
4202
+ chIdx ++ ;
4203
+ document . getElementById ( "progressBarChild" ) . style . width = ( chIdx + 1 ) * 100 / self . outChannels + "%" ;
4209
4204
}
4210
- chIdx ++ ;
4211
- // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
4212
- //document.getElementById("progressBarChild").style.width = (chIdx + 1)*100/self.outChannels + "%";
4205
+
4206
+
4213
4207
} , 10 ) ;
4214
4208
} ) ;
4215
4209
0 commit comments