You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/11/29 07:11:16 UTC

[GitHub] [incubator-mxnet] sxjscience opened a new issue #19595: [Bug] Serialization Bug

sxjscience opened a new issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595


   ## Description
   I noticed a serialization bug when rerunning the machine translation example in GluonNLP. This might be due to the recently upgraded serialization format.
   
   Here's the reproducible example:
   ```python
   import mxnet as mx
   import numpy as np
   mx.npx.set_np()
   
   net = mx.gluon.nn.Embedding(input_dim=32768, output_dim=512)
   net.initialize()
   net.save_parameters('temp.params')
   original_weight = net.collect_params()['weight'].data().asnumpy()
   loaded_params = mx.npx.load('temp.params')
   loaded_weight = loaded_params['weight'].asnumpy()
   np.testing.assert_allclose(original_weight, loaded_weight, 1E-4, 1E-4)
   ```
   Output:
   
   ```
   ---> 11 np.testing.assert_allclose(original_weight, loaded_weight, 1E-4, 1E-4)
   
       [... skipping hidden 2 frame]
   
   AssertionError: 
   Not equal to tolerance rtol=0.0001, atol=0.0001
   
   Mismatched elements: 16735981 / 16777216 (99.8%)
   Max absolute difference: 0.13994947
   Max relative difference: 4780370.5
    x: array([[-0.019636,  0.020329, -0.045591, ..., -0.036925, -0.007389,
            0.043669],
          [-0.01338 ,  0.055998,  0.046903, ..., -0.006462,  0.001994,...
    y: array([[-0.019636,  0.020329, -0.045591, ..., -0.036925, -0.007389,
            0.043669],
          [-0.01338 ,  0.055998,  0.046903, ..., -0.006462,  0.001994,...
   ```
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] sxjscience commented on issue #19595: [Bug] Serialization Bug

Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595#issuecomment-735447166


   I tried the 20201117 wheel and it does not have the issue. So I think it's introduced by the recent npx.savez PR.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] szha commented on issue #19595: [Bug] Serialization Bug

Posted by GitBox <gi...@apache.org>.
szha commented on issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595#issuecomment-735411295


   I can reproduce. Added a couple of `waitall()` calls didn't resolve it so I think it's not related to synchronization. Thus, I think it's related to serialization/deserialization itself.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] sxjscience commented on issue #19595: [Bug] Serialization Bug

Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595#issuecomment-735353971


   @leezu @szha This is a very serious bug and we need to fix it. Would you try to verify the bug?


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] leezu closed issue #19595: [Bug] Serialization Bug

Posted by GitBox <gi...@apache.org>.
leezu closed issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595


   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] sxjscience commented on issue #19595: [Bug] Serialization Bug

Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #19595:
URL: https://github.com/apache/incubator-mxnet/issues/19595#issuecomment-735436263


   This is quite critical...... I trained several NMT models but the weights are not saved appropriately....


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org