float123 opened a new issue #17892: How to get the output of the specified 
layer?
URL: https://github.com/apache/incubator-mxnet/issues/17892
 
 
   Hi,
   I need to get the output of a certain layer, I did the following:
   ```
   sym, arg_params, aux_params = mx.model.load_checkpoint('./data/retina', 0)
   print('sym', sym) # [face_rpn_cls_prob_reshape_stride32, 
face_rpn_bbox_pred_stride32, face_rpn_landmark_pred_stride32,.......]
   
   data = mx.sym.Variable('data')
   sym1 = mx.sym.Variable('face_rpn_cls_prob_reshape_stride32')
   group = data + sym1
   group= group.get_internals()
   
   mod = mx.mod.Module(symbol=group, context=mx.gpu(0), label_names=None)
   mod.bind(data_shapes=[('data', (1, 3, 600, 600))], for_training=False)
   mod.set_params(arg_params, aux_params)
   
   mod.forward(img, is_train=False)
   net_out = mod.get_outputs()
   ```
   RuntimeError: face_rpn_cls_prob_reshape_stride32 is not presented
   
   or
   ```
   data = mx.sym.Variable('data')
   sym1 = mx.sym.Variable('face_rpn_cls_prob_reshape_stride32')
   sym1 = sym1.get_internals()
   group = mx.symbol.Group([data, sym1])
   mod = mx.mod.Module(symbol=group, context=mx.gpu(0), label_names=None)
   
   ```
   RuntimeError: simple_bind error. Arguments:
   data: (1, 3, 600, 600)
   [23:49:46] src/executor/../common/exec_utils.h:392: InferShape pass cannot 
decide shapes for the following arguments (-1 means unknown dimensions). Please 
consider providing them as inputs:
   face_rpn_cls_prob_reshape_stride32: None
   
   or
   ```
   sym1 = mx.sym.Variable('face_rpn_cls_prob_reshape_stride32')
   group= sym1.get_internals()
   
   mod = mx.mod.Module(symbol=group, context=mx.gpu(0), label_names=None)
   ```
   
   ValueError: You created Module with Module(..., data_names=['data']) but 
input with name 'data' is not found in symbol.list_arguments(). Did you mean 
one of:
        face_rpn_cls_prob_reshape_stride32
   
   
   I always encounter these  problems when using .get_internals () and 
mx.symbol.Group (),Using the output face_rpn_cls_prob_reshape_stride32_output 
will also have an error. how do I need to do it? thank you very much.
   
   
   
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to