This is an automated email from the ASF dual-hosted git repository.
thomasdelteil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 3d20f2a add filter to warnings (#14532)
3d20f2a is described below
commit 3d20f2ac64c917124b68812dbb3cb2b8eb6cfc05
Author: Thomas Delteil <[email protected]>
AuthorDate: Tue Mar 26 17:24:33 2019 -0700
add filter to warnings (#14532)
---
docs/tutorials/gluon/hybrid.md | 1 +
docs/tutorials/gluon/save_load_params.md | 1 +
docs/tutorials/onnx/fine_tuning_gluon.md | 1 +
docs/tutorials/onnx/inference_on_onnx_model.md | 1 +
docs/tutorials/python/module_to_gluon.md | 5 ++++-
5 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/tutorials/gluon/hybrid.md b/docs/tutorials/gluon/hybrid.md
index 0129672..9de9713 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 61dad42..26d6b89 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 1271dfc..e7cef68 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 654d0c1..1c946bf 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 5ab9d88..838ad66 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()))
```