You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/06/18 08:04:51 UTC

[GitHub] [incubator-mxnet] lucinyaLi edited a comment on issue #14810: Add the Gluon Implementation of Deformable Convolution

lucinyaLi edited a comment on issue #14810: Add the Gluon Implementation of Deformable Convolution
URL: https://github.com/apache/incubator-mxnet/pull/14810#issuecomment-502994530
 
 
   @ suyz526
   This is a part of my net, I change some original conv layer in SSD into the deformable conv. There is nothing else I have changed. 
       with self.name_scope():
               # we use pre-trained weights from caffe, initial scale must change
               init_scale = mx.nd.array([0.229, 0.224, 0.225]).reshape((1, 3, 1, 1)) * 255
               self.init_scale = self.params.get_constant('init_scale', init_scale)
               self.stages = nn.HybridSequential()
               for l, f in zip(layers, filters):
                   stage = nn.HybridSequential(prefix='')
                   with stage.name_scope():
                           for _ in range(l):
                               stage.add(DeformableConvolution(f, kernel_size=3, padding=1, **self.init))
                               if batch_norm:
                                   stage.add(nn.BatchNorm())
                               stage.add(nn.Activation('relu'))
                   self.stages.add(stage)
   and then
       net.initialize(ctx=ctx) # where ctx=gpu(1)
       net.load_parameters(path, ctx=ctx)
   I think all the parameter are stored on GPU. Is it right ? But the error  :
   RuntimeError: Parameter 'ssd0_vggatrousextractor0_init_scale' was not initialized on context cpu(0). It was only initialized on [gpu(1)].
   What the error mean is that I should initialize the self.init_scale in CPU?

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


With regards,
Apache Git Services