jeremiedb commented on issue #7968: [R] Transfer Learning using VGG-16
URL: 
https://github.com/apache/incubator-mxnet/issues/7968#issuecomment-356796232
 
 
   Adding the gc() in the function arguments won't have effect during training 
time. 
   gc() needs to be added within the function definition, ie:  
   
   ```
   x = function(a, b) {
     y = a*b
     gc()
   return(y)
   }
   ```
   Calling `x(a=1, b=2, gc())` just won't work since you're passing function 
arguments. 
   You would need to add the gc() here:: 
https://github.com/apache/incubator-mxnet/blob/master/R-package/R/model.R#L221
   To be effective, you'll need to source these functions, and note that some 
of the dependent functions are not exported in the package, requiring to call 
them through mxnet:::<function_name>. 
   
   As a quick alternative, you can train using the following function that 
should work straight: 
   https://github.com/jeremiedb/mxnet_R_bucketing/blob/master/model.rnn.R#L127
   Add gc() at line 127, then can train the model with mx.model.buckets. 

----------------------------------------------------------------
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