-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
@@ -762,7 +762,7 @@ def test_export(): | |||
model = gluon.model_zoo.vision.resnet18_v1( | |||
prefix='resnet', ctx=ctx, pretrained=True) | |||
model.hybridize() | |||
data = mx.nd.random.normal(shape=(1, 3, 224, 224)) | |||
data = mx.nd.random.normal(shape=(1, 3, 32, 32)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faster
python/mxnet/gluon/block.py
Outdated
@@ -885,6 +885,50 @@ class SymbolBlock(HybridBlock): | |||
>>> x = mx.nd.random.normal(shape=(16, 3, 224, 224)) | |||
>>> print(feat_model(x)) | |||
""" | |||
@staticmethod | |||
def import_(symbol_file, input_names, param_file=None, ctx=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think import_
is a great name, even though I understand that we want to be as close as possible to .export
and import
being a key-word makes it impossible to use .import()
.
I would suggest adding an alias to export, export_symbols
export_to_symbol
export_hybridized
, etc and have the matching one for import. That way it would be clearer, as adding a _
suffix is not a conventionnal thing to do and is close to the use of _
as a prefix, which is for private functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think imports
is a good compromise in terms of naming 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe the save_params change is a step in the right direction.
python/mxnet/gluon/block.py
Outdated
present in this Block. | ||
""" | ||
warnings.warn("load_params is deprecated. Please use load_parameters.") | ||
import pdb;pdb.set_trace() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these pdb statements here and elsewhere ?
Can you please update the tutorial here: https://github.com/apache/incubator-mxnet/blob/master/docs/tutorials/gluon/save_load_params.md to show the new simpler usage of Just read the tutorial and noticed a few things that are wrong because of how it was iteratively updated: |
python/mxnet/gluon/block.py
Outdated
Path to file. | ||
""" | ||
warnings.warn("save_params is deprecated. Please use save_parameters.") | ||
self.collect_params().save(filename, strip_prefix=self.prefix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not make this change to the save_params.
filename : str | ||
Path to file. | ||
""" | ||
warnings.warn("save_params is deprecated. Please use save_parameters.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we add something about export? Something like "If you are using an hybridized model and want to serialize it to obtain the network structure and parameters, please refer to HybridBlock.export()"
Wasn't the final decision to provide deprecation warning for |
@anirudh2290, no, such change would break users who are on 1.2.0. |
@@ -61,7 +61,7 @@ def build_lenet(net): | |||
net.add(gluon.nn.Dense(512, activation="relu")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L13 there is also "load_checkpoint
and load
methods" -> "imports
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can make this change as part of another PR to avoid another round of CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry didnt realize this was already in.
* add import_ for SymbolBlock * fix * Update block.py * add save_parameters * fix * fix lint * fix * fix * fix * fix * fix * Update save_load_params.md
* add import_ for SymbolBlock * fix * Update block.py * add save_parameters * fix * fix lint * fix * fix * fix * fix * fix * Update save_load_params.md
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments