diff --git a/docs/tutorials/gluon/hybrid.md b/docs/tutorials/gluon/hybrid.md index 01296722e4f3..9de9713403dc 100644 --- a/docs/tutorials/gluon/hybrid.md +++ b/docs/tutorials/gluon/hybrid.md @@ -157,6 +157,7 @@ to gluon with `SymbolBlock`: import warnings with warnings.catch_warnings(): + warnings.simplefilter("ignore") net2 = gluon.SymbolBlock.imports('model-symbol.json', ['data'], 'model-0001.params') ``` diff --git a/docs/tutorials/gluon/save_load_params.md b/docs/tutorials/gluon/save_load_params.md index 61dad4263531..26d6b8924b3c 100644 --- a/docs/tutorials/gluon/save_load_params.md +++ b/docs/tutorials/gluon/save_load_params.md @@ -262,6 +262,7 @@ Serialized Hybrid networks (saved as .JSON and .params file) can be loaded and u ```python import warnings with warnings.catch_warnings(): + warnings.simplefilter("ignore") deserialized_net = gluon.nn.SymbolBlock.imports("lenet-symbol.json", ['data'], "lenet-0001.params", ctx=ctx) ``` diff --git a/docs/tutorials/onnx/fine_tuning_gluon.md b/docs/tutorials/onnx/fine_tuning_gluon.md index 1271dfc02f89..e7cef6809b10 100644 --- a/docs/tutorials/onnx/fine_tuning_gluon.md +++ b/docs/tutorials/onnx/fine_tuning_gluon.md @@ -281,6 +281,7 @@ We create a symbol block that is going to hold all our pre-trained layers, and a ```python import warnings with warnings.catch_warnings(): + warnings.simplefilter("ignore") pre_trained = gluon.nn.SymbolBlock(outputs=new_sym, inputs=mx.sym.var('data_0')) net_params = pre_trained.collect_params() for param in new_arg_params: diff --git a/docs/tutorials/onnx/inference_on_onnx_model.md b/docs/tutorials/onnx/inference_on_onnx_model.md index 654d0c11bcba..1c946bffcc06 100644 --- a/docs/tutorials/onnx/inference_on_onnx_model.md +++ b/docs/tutorials/onnx/inference_on_onnx_model.md @@ -146,6 +146,7 @@ And load them into a MXNet Gluon symbol block. ```python import warnings with warnings.catch_warnings(): + warnings.simplefilter("ignore") net = gluon.nn.SymbolBlock(outputs=sym, inputs=mx.sym.var('data_0')) net_params = net.collect_params() for param in arg_params: diff --git a/docs/tutorials/python/module_to_gluon.md b/docs/tutorials/python/module_to_gluon.md index 5ab9d88cbd23..838ad667836d 100644 --- a/docs/tutorials/python/module_to_gluon.md +++ b/docs/tutorials/python/module_to_gluon.md @@ -334,7 +334,10 @@ print("Output probabilities: {}".format(prob)) For the Gluon API, it is a lot simpler. You can just load a serialized model in a [`SymbolBlock`](https://mxnet.incubator.apache.org/api/python/gluon/gluon.html?highlight=symbolblo#mxnet.gluon.SymbolBlock) and run inference directly. ```python -net = gluon.SymbolBlock.imports('module-model-symbol.json', ['data', 'softmax_label'], 'module-model-0005.params') +import warnings +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + net = gluon.SymbolBlock.imports('module-model-symbol.json', ['data', 'softmax_label'], 'module-model-0005.params') prob = net(mx.nd.ones((1,1,28,28)), mx.nd.ones(1)) # note the second argument here to account for the softmax_label symbol print("Output probabilities: {}".format(prob.asnumpy())) ```