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 2018/08/03 01:31:45 UTC

[GitHub] szha commented on issue #12018: onnx converter error

szha commented on issue #12018: onnx converter error
URL: https://github.com/apache/incubator-mxnet/issues/12018#issuecomment-410116703
 
 
   The reported error message:
   ```
   KeyError                                  Traceback (most recent call last)
   <ipython-input-5-7912d84df342> in <module>()
         1 if __name__ == '__main__':
         2     #print(50000/16*15)
   ----> 3     loadShuffleNet()
         4 
   
   <ipython-input-4-c7bde65da337> in loadShuffleNet()
        22     path = '/media/jiaming/Seagate Backup Plus Drive/pretrain_model/shufflenet/'
        23     onnx_path = path + 'model.onnx'
   ---> 24     sym, arg_params, aux_params = onnx_mxnet.import_model(onnx_path)
        25     (new_sym, new_args) = get_sn_finetune(sym, arg_params, 7)
        26 
   
   ~/.local/lib/python3.6/site-packages/mxnet/contrib/onnx/_import/import_model.py in import_model(model_file)
        51     # loads model file and returns ONNX protobuf object
        52     model_proto = onnx.load(model_file)
   ---> 53     sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
        54     return sym, arg_params, aux_params
        55 
   
   ~/.local/lib/python3.6/site-packages/mxnet/contrib/onnx/_import/import_onnx.py in from_onnx(self, graph)
       112             onnx_attr = self._parse_attr(node.attribute)
       113             inputs = [self._nodes[i] for i in node.input]
   --> 114             mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs)
       115 
       116             for k, i in zip(list(node.output), range(len(mxnet_sym.list_outputs()))):
   
   ~/.local/lib/python3.6/site-packages/mxnet/contrib/onnx/_import/import_onnx.py in _convert_operator(self, node_name, op_name, attrs, inputs)
        56         """
        57         if op_name in convert_map:
   ---> 58             op_name, new_attrs, inputs = convert_map[op_name](attrs, inputs, self)
        59         else:
        60             raise NotImplementedError("Operator {} not implemented.".format(op_name))
   
   ~/.local/lib/python3.6/site-packages/mxnet/contrib/onnx/_import/op_translations.py in batch_norm(attrs, inputs, cls)
       172 
       173     # in test mode "fix_gamma" should be unset.
   --> 174     new_attrs['fix_gamma'] = 0 if new_attrs['fix_gamma'] == 1 else 1
       175     return 'BatchNorm', new_attrs, inputs
       176 
   
   KeyError: 'fix_gamma'
   ```

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