Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Nightly test fix: add filter to warnings #14532

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/tutorials/gluon/hybrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
```

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/gluon/save_load_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/onnx/fine_tuning_gluon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/onnx/inference_on_onnx_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion docs/tutorials/python/module_to_gluon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
```
Expand Down