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/05/20 17:18:51 UTC

[GitHub] [incubator-mxnet] jmerkow edited a comment on issue #14421: Updating mxnet from 1.0.0, networks give different outputs

jmerkow edited a comment on issue #14421: Updating mxnet from 1.0.0, networks give different outputs
URL: https://github.com/apache/incubator-mxnet/issues/14421#issuecomment-494057080
 
 
   Ok I am working on this again.
   
   I've checked that the parameter files are the same. i.e. something like this:
   ```
   ## in a docker with mx1.4.0 loaded
   np_arg_params = {key: value.asnumpy() for key, value in arg_params.items()}
   np.save('mx140.npy', np_arg_params)
   ...
   
   ## in another docker with mx100 loaded
   import numpy as np
   np_arg_params2 = np.load('../140/mx140.npy')[()]
   assert set(np_arg_params2.keys()).difference(np_arg_params.keys()) == set()
   assert set(np_arg_params.keys()).difference(np_arg_params2.keys()) == set()
   assert all((np_arg_params[k]-np_arg_params2[k]).sum() ==0 for k in np_arg_params.keys())
   ```
   I double checked that the actual input to the image is the same (after transforms etc).
   
   We use the module doing something like this:
   ```
           mod.forward(batch) # batch is basically a named tuple with an NDArray at batch.data
           output = mod.get_outputs()[0].asnumpy() 
   ```
   
   EDIT: Ok I went through and save the outputs of each layer, and I tracked down the first output that has a difference and its a run-of-the-mill 2D convolution layer:
   
   ```
   [{u'attr': {u'kernel': u'(3, 3)',
      u'no_bias': u'True',
      u'num_filter': u'96',
      u'pad': u'(0, 0)',
      u'stride': u'(1, 1)'},
     u'inputs': [[42, 0, 0], [43, 0, 0]],
     u'name': u'in_stem_conv6_3*3_conv2d',
     u'op': u'Convolution'}]
   ```
   
   
   
   

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