fedorzh commented on issue #9185: Gluon provided ResNet does not get desirable accuracy on CIFAR10 URL: https://github.com/apache/incubator-mxnet/issues/9185#issuecomment-357395356 I also tried to train with the Module rather than with the gluon Trainer: ``` model_name = 'resnet18_v2' gpu_count = 1 _ctx_list = [mx.gpu(i) for i in range(gpu_count)] net = gluon.model_zoo.vision.get_model(model_name, pretrained=False, classes=len(np.unique(y)), ctx=_ctx_list) #net = gluon.model_zoo.vision.ResNetV2(block=gluon.model_zoo.vision.BasicBlockV2, layers=units, channels=filter_list, classes=len(np.unique(y))) net_sym = net(mx.sym.var('data')) presaved_symbol = mx.symbol.SoftmaxOutput(data=net_sym, name='softmax') arg_params = None aux_params = None gpu_count = 1 begin_epoch = 0 lr = 0.1 mom = 0.9 wd = 0.0001 num_examples = 50000 frequent = 1000 devs = [mx.gpu(i) for i in range(gpu_count)] epoch_size = max(int(num_examples / batch_size / kv.num_workers), 1) model_prefix = "model/resnet-{}-{}-{}".format(data_type, depth, kv.rank) checkpoint = mx.callback.do_checkpoint(model_prefix) def multi_factor_scheduler(begin_epoch, epoch_size, step=[60, 75, 90], factor=0.1): step_ = [epoch_size * (x-begin_epoch) for x in step if x-begin_epoch > 0] return mx.lr_scheduler.MultiFactorScheduler(step=step_, factor=factor) if len(step_) else None mfs = multi_factor_scheduler(begin_epoch, epoch_size, step=[120, 160], factor=0.1) module = mx.mod.Module( context = devs, symbol = presaved_symbol) module.fit( initializer = mx.init.Xavier(rnd_type='gaussian', factor_type="in", magnitude=2), arg_params = arg_params, aux_params = aux_params, optimizer = 'nag', optimizer_params = dict( learning_rate = lr, momentum = mom, wd = wd, lr_scheduler = mfs), train_data = train, eval_data = val, eval_metric = 'acc', epoch_end_callback = checkpoint, batch_end_callback = mx.callback.Speedometer(batch_size, frequent), kvstore = kv, begin_epoch = begin_epoch, num_epoch = 25 ) ```
---------------------------------------------------------------- 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
