Junyuan Xie created MXNET-518:
---------------------------------

             Summary: save_params break in 1.2
                 Key: MXNET-518
                 URL: https://issues.apache.org/jira/browse/MXNET-518
             Project: Apache MXNet
          Issue Type: Bug
            Reporter: Junyuan Xie


Issue:

The following code works in 1.1 but doesn't work in 1.2:

a = net(mx.sym.var('data'))
a.save('test.json')
net.save_params('test.params')
model = gluon.nn.SymbolBlock(outputs=mx.sym.load_json(open('test.json', 
'r').read()),
                                 inputs=mx.sym.var('data'))
model.load_params('test.params', ctx=ctx)

This code is shown in Zack's book but is not recommended and relies on 
undefined behavior. We didn't intend save_params and load_params to be used 
across HybridBlock and SymbolBlock.

Reason:

In order to fix a bug related to name_scope and save_params, we changed the 
behavior of save_params and the above code breaks.

Solution 1:

Release 1.2.1 and revert save_params to the old behavior by default. Add a new 
option for the new behavior.

Pros:
1. 1.2.1 will be backward compatible with 1.1
2. Users depending on the above code will not see breaking changes

Cons:
1. 1.2.1 will be non-compatible with 1.2. This is a second breakage and will 
potentially impact more users than the breakage from 1.2 to 1.1.
2. Users will again be seeing the bug that was previously fixed. To avoid the 
bug, all users need to manually set the new option when using save_params. Code 
will be ugly.
3. We will need to update all documents, including the Chinese book, too 
manually set the new option.

Solution 2:

Add a warning message to point users impacted by this breakage to the 
recommended solution. Update book recommended solution.

Pros:
1. 1.2.1 will be compatible with 1.2.
2. Bug remains fixed. save_params API will be clean.

Cons:
1. 1.2.1 will still be non-compatible with 1.1
2. Users impacted by the above breakage will have to manually switch to new 
solution.`





--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to