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/01/03 06:05:10 UTC

[GitHub] miteshyh edited a comment on issue #13751: There could be genuine duplicate output names?

miteshyh edited a comment on issue #13751: There could be genuine duplicate output names? 
URL: https://github.com/apache/incubator-mxnet/issues/13751#issuecomment-451061506
 
 
   thanks @leleamol 
   
   It gets reproduced with default  PSPNET with ResNet50 backbone, I use it from GluonCV model zoo.
   
   Below is the minimum code to repro.
   
   ```
   import numpy as np
   from PIL import Image
   import mxnet as mx
   from mxnet import gluon, autograd, image
   import gluoncv
   from mxnet.gluon.data.vision import transforms
   
   ctx = mx.cpu()
   model = gluoncv.model_zoo.PSPNet(2, norm_layer=mx.gluon.contrib.nn.SyncBatchNorm, ctx=ctx,pretrained_base=False)
   
   transform_fn = transforms.Compose([
       transforms.ToTensor()])
   
   #use some (R,G,B) image in PNG format with dims 480 X 480
   img = Image.open('/path/to/some/image.png')
   img = transform_fn(mx.nd.array(img))
   img = img.expand_dims(0).as_in_context(mx.cpu())
   
   model.hybridize()
   # I do not use pretrained weights for some reason so initialize
   model.initialize(ctx=ctx)
   model(mx.nd.array(img))
   
   model_sym = model._cached_graph[1]
   
   sym_graph = model_sym.get_internals()
   
   for sym in sym_graph.get_children():
       print '=>',sym
   
   ```
   Below is the stack trace ( Line numbers may slightly differ due to some debug lines)
   ---------------------------------------------------------------------------
   ValueError                                Traceback (most recent call last)
   <ipython-input-5-67db4393f07b> in <module>()
        25 sym_graph = model_sym.get_internals()
        26 
   ---> 27 for sym in sym_graph.get_children():
        28     print '=>',sym
   
   /usr/local/lib/python2.7/dist-packages/mxnet/symbol/symbol.pyc in <genexpr>((i,))
        91         <Symbol _plus0>
        92         """
   ---> 93         return (self[i] for i in self.list_outputs())
        94 
        95     def __add__(self, other):
   
   /usr/local/lib/python2.7/dist-packages/mxnet/symbol/symbol.pyc in __getitem__(self, index)
   
   --> 523                         raise ValueError('There are multiple outputs with name \"%s\"' % index)
       524                     idx = i
       525             if idx is None:
   
   ValueError: There are multiple outputs with name "pspnet4_resnetv1s_pool0_fwd_output"
   
   **"pspnet4_resnetv1s_pool0_fwd_output" is fed to next block and skip connection.**
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services