Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
fix tutorial build (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Mar 12, 2018
1 parent badbd7d commit 770f6ff
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tutorials/from_mxnet_to_webgl.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@

# This tutorial must be run with OpenGL backend enabled in TVM.
# The NNVM CI does not enable OpenGL yet. But the user can run this script.
if not tvm.module.enabled("opengl"):
print("OpenGL backend not enabled. This tutorial cannot be run.")
exit(0)
opengl_enabled = tvm.module.enabled("opengl")

# To run the local demo, set this flag to True.
run_deploy_local = False
Expand Down Expand Up @@ -308,7 +306,7 @@ def deploy_local():
synset = download_synset()
print('TVM prediction top-1:', top1, synset[top1])

if run_deploy_local:
if run_deploy_local and opengl_enabled:
deploy_local()

######################################################################
Expand Down Expand Up @@ -412,7 +410,7 @@ def deploy_rpc():
# Print first 10 elements of output.
print(out.asnumpy()[0][0:10])

if run_deploy_rpc:
if run_deploy_rpc and opengl_enabled:
deploy_rpc()

######################################################################
Expand Down Expand Up @@ -501,5 +499,5 @@ def deploy_web():
print("Please open http://localhost:" + str(port) + "/resnet.html")
httpd.serve_forever()

if run_deploy_web:
deploy_web()
if run_deploy_web and opengl_enabled:
deploy_web()

0 comments on commit 770f6ff

Please sign in to comment.