lichen11 commented on issue #7968: [R] Transfer Learning using VGG-16
URL: 
https://github.com/apache/incubator-mxnet/issues/7968#issuecomment-356726078
 
 
   I added gc() quite a few times before training and three times within 
training. Please see below:
   
       gc()
       model <- mx.model.FeedForward.create(
         gc(),
         symbol             = new_soft,
         X                  = train,
         eval.data          = val,
         ctx                = mx.gpu(0),
         eval.metric        = mx.metric.accuracy,
         num.round          = 1,
         learning.rate      = 0.05,
         momentum           = 0.9,
         wd                 = 0.00001,
         kvstore            = "local",
         array.batch.size   = 5,
         gc(),
         epoch.end.callback = mx.callback.save.checkpoint("resnet"), #save the 
params value.
         batch.end.callback = mx.callback.log.train.metric(150),
         initializer        = mx.init.Xavier(rnd_type='gaussian', factor_type = 
"in", magnitude = 2),
         optimizer          = "sgd",
         arg.params         = arg_params_new,
         allow.extra.params = T,
         aux.params         = resnet101$aux.params,
         gc()
    )

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