Skip to content

Commit

Permalink
fix tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiics committed Jun 13, 2019
1 parent 8a148f3 commit 9282b89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tutorials/frontend/deploy_model_on_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ def transform_image(image):

input_name = 'input_1'
shape_dict = {input_name: x.shape}
func, params = relay.frontend.from_keras(keras_mobilenet_v2, shape_dict)
mod, params = relay.frontend.from_keras(keras_mobilenet_v2, shape_dict)

with relay.build_config(opt_level=3):
graph, lib, params = relay.build(func, target=target,
graph, lib, params = relay.build(mod[mod.entry_func], target=target,
target_host=target_host, params=params)

# After `relay.build`, you will get three return values: graph,
Expand Down
3 changes: 2 additions & 1 deletion tutorials/frontend/deploy_model_on_rasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ def transform_image(image):

# We support MXNet static graph(symbol) and HybridBlock in mxnet.gluon
shape_dict = {'data': x.shape}
func, params = relay.frontend.from_mxnet(block, shape_dict)
mod, params = relay.frontend.from_mxnet(block, shape_dict)
# we want a probability so add a softmax operator
func = mod[mod.entry_func]
func = relay.Function(func.params, relay.nn.softmax(func.body), None, func.type_params, func.attrs)

######################################################################
Expand Down
4 changes: 2 additions & 2 deletions tutorials/frontend/deploy_ssd_gluoncv.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
block = model_zoo.get_model(model_name, pretrained=True)

def build(target):
net, params = relay.frontend.from_mxnet(block, {"data": dshape})
mod, params = relay.frontend.from_mxnet(block, {"data": dshape})
with relay.build_config(opt_level=3):
graph, lib, params = relay.build(net, target, params=params)
graph, lib, params = relay.build(mod[mod.entry_func], target, params=params)
return graph, lib, params

######################################################################
Expand Down

0 comments on commit 9282b89

Please sign in to comment.