QueensGambit commented on issue #15337: Current MXNet-Dev master breaks loading 
of certain models
URL: 
https://github.com/apache/incubator-mxnet/issues/15337#issuecomment-513383904
 
 
   I think, I know why the loading fails, thank you for help @roywei. It's 
because I ported the training code from Gluon to MXNet for this model. The 
reason for this was that I experienced long delays during training due to 
`MXNET_CUDNN_AUTOTUNE_DEFAULT` calls:
   * https://github.com/apache/incubator-mxnet/issues/15529
    
   Apparently in MXNet version 1.4.1 the code above works successfully and 
ignores the missing label information whereas version 1.5.0 blocks it, which is 
a behaviour I appreciate.
   
   Using this code I'm able to successfully load the model both in version 
MXNet 1.4.1 and MXNet 1.5.0:
   ```python
   model_arch_path = 'model-1.19246-0.603-symbol.json'
   model_params_path = 'model-1.19246-0.603-0223.params'
   ctx = mx.cpu()
   symbol = mx.sym.load(model_arch_path)
   inputs = mx.sym.var('data', dtype='float32')
   value_out = symbol.get_internals()['value_tanh0_output']
   policy_out = symbol.get_internals()['flatten0_output']
   sym = mx.symbol.Group([value_out, policy_out])
   net = mx.gluon.SymbolBlock(sym, inputs)
   net.collect_params().load(model_params_path, ctx)
   ```
   Consequently, I think this issue can be closed.

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