larroy commented on issue #10856: Failed OpenMP assertion when loading MXNet 
compiled with DEBUG=1
URL: 
https://github.com/apache/incubator-mxnet/issues/10856#issuecomment-505130046
 
 
   ```
   (py3_venv) pllarroy@elite:134: ~/d/GradOptMXNet [autograd_fixes]> cat 
fc_mx.py
   #!/usr/bin/env python
   # -*- coding: utf-8 -*-
   import mxnet as mx
   import mxnet.autograd as ag
   from mxnet import nd
   from mxnet import gluon
   import sys
   
   
   def main():
       x = nd.array([[0.2131, 0.5449, 0.9910],
           [0.1600, 0.1665, 0.1387],
           [0.6242, 0.0409, 0.0663],
           [0.6590, 0.9822, 0.3108],
           [0.8566, 0.3848, 0.8385]])
       x.attach_grad()
       net = gluon.nn.Sequential()
       with net.name_scope():
           net.add(gluon.nn.Dense(3))
           #net.initialize()
       net.initialize(mx.init.Xavier(magnitude=2.24))
       w = net.collect_params().values()
       print(f"w {w}")
       with ag.record():
           y = net.forward(x)
           x_grad = ag.grad(y, x, create_graph=True, retain_graph=True)[0]
       print(x_grad)
       return 1
   
   if __name__ == '__main__':
       sys.exit(main())
   ```
   
   Build options, defaults as in 
https://github.com/apache/incubator-mxnet/blob/master/cmake/cmake_options.yml
   
   The crash happened as I was running the script above.
   
   
   

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