some-guy1 opened a new issue #9453: [R] CNN Memory Leak - Needs to somehow call 
Garbage Collector
URL: https://github.com/apache/incubator-mxnet/issues/9453
 
 
   ## Description
   Memory constantly increases until out of memory of machine.  Using the 
following code.  The memory does not release even after Mxnet finishes 
requested iterations.  If I use the gc() command, all memory is released.  
**How can I call gc() during Mxnet optimizing?**  Or is there a different work 
around?
   
   Input is a 16x16x3 data set.  Should be fairly easy to solve.  
   
   `train_iter = mx.io.arrayiter(data = train.x, label = train.y    )`
   `data <- mx.symbol.Variable('data')`
   `conv_1 <- mx.symbol.Convolution(data= data, kernel = c(2,2), num_filter = 
30)`
   `tanh_1 <- mx.symbol.Activation(data= conv_1, act_type = "tanh")`
   `fcl_2 <- mx.symbol.FullyConnected(data = tanh_1, num_hidden = 256)`
   `fcl_2 <- mx.symbol.reshape(fcl_2, shape=c(16,16,1,128))`
   `NN_Model <- mx.symbol.LinearRegressionOutput(data=fcl_2, name="lro")`
   `mx.set.seed(100)`
   
   `conv.net.model <- mx.model.FeedForward.create(NN_Model, X=train_iter,`
   `    ctx=mx.cpu(), num.round=150, array.batch.size=1,`
   `    learning.rate=5e-4, array.layout = "rowmajor",`
   `    eval.metric = mx.metric.mse, optimizer = "rmsprop",`
   `    verbose = TRUE) `
   
   MXnet R 0.10.1
   R version 3.4.3 (2017-11-30)
   Platform: x86_64-w64-mingw32/x64 (64-bit)
   Running under: Windows >= 8 x64 (build 9200)
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to