From be6b8bb86611dc554f19deef6f6f5afd23b503f5 Mon Sep 17 00:00:00 2001 From: Thierry Moreau Date: Thu, 18 Jul 2019 13:27:19 -0700 Subject: [PATCH] avoiding cast None to int errors --- vta/scripts/tune_conv2d.py | 4 ++-- vta/scripts/tune_dense.py | 4 ++-- vta/scripts/tune_resnet.py | 4 ++-- vta/scripts/tune_resnet_nnvm.py | 4 ++-- vta/tutorials/frontend/deploy_resnet_on_vta.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vta/scripts/tune_conv2d.py b/vta/scripts/tune_conv2d.py index f55c7e985716..5f3f9068d72c 100644 --- a/vta/scripts/tune_conv2d.py +++ b/vta/scripts/tune_conv2d.py @@ -91,7 +91,7 @@ def conv2d(N, CI, H, W, CO, KH, KW, strides, padding, dilation, in_dtype, out_dt # Get tracker info from env tracket_host = os.environ.get("TVM_TRACKER_HOST", None) - tracket_port = int(os.environ.get("TVM_TRACKER_PORT", None)) + tracket_port = os.environ.get("TVM_TRACKER_PORT", None) if not tracket_host or not tracket_port: print("Set your AutoTVM tracker node host and port variables to run the autotuner") exit() @@ -118,7 +118,7 @@ def conv2d(N, CI, H, W, CO, KH, KW, strides, padding, dilation, in_dtype, out_dt measure_option = autotvm.measure_option( builder=autotvm.LocalBuilder(build_func=vta.vta_autotvm_build_func), - runner=autotvm.RPCRunner(env.TARGET, tracket_host, tracket_port, number=4, repeat=3, timeout=10000, + runner=autotvm.RPCRunner(env.TARGET, tracket_host, int(tracket_port), number=4, repeat=3, timeout=10000, check_correctness=True)) tuner = autotvm.tuner.RandomTuner(task) diff --git a/vta/scripts/tune_dense.py b/vta/scripts/tune_dense.py index 237ca2754512..e3d267769aec 100644 --- a/vta/scripts/tune_dense.py +++ b/vta/scripts/tune_dense.py @@ -75,7 +75,7 @@ def dense(N, CI, CO): # Get tracker info from env tracket_host = os.environ.get("TVM_TRACKER_HOST", None) - tracket_port = int(os.environ.get("TVM_TRACKER_PORT", None)) + tracket_port = os.environ.get("TVM_TRACKER_PORT", None) if not tracket_host or not tracket_port: print("Set your AutoTVM tracker node host and port variables to run the autotuner") exit() @@ -93,7 +93,7 @@ def dense(N, CI, CO): measure_option = autotvm.measure_option( builder=autotvm.LocalBuilder(build_func=vta.vta_autotvm_build_func), - runner=autotvm.RPCRunner(env.TARGET, tracket_host, tracket_port, number=4, repeat=3, timeout=10000, + runner=autotvm.RPCRunner(env.TARGET, tracket_host, int(tracket_port), number=4, repeat=3, timeout=10000, check_correctness=True)) tuner = autotvm.tuner.RandomTuner(task) diff --git a/vta/scripts/tune_resnet.py b/vta/scripts/tune_resnet.py index 80a213ccd3ff..00fe1e87a7fa 100644 --- a/vta/scripts/tune_resnet.py +++ b/vta/scripts/tune_resnet.py @@ -201,7 +201,7 @@ def tune_tasks(tasks, # Get remote from fleet node tracker_host = os.environ.get("TVM_TRACKER_HOST", None) - tracker_port = int(os.environ.get("TVM_TRACKER_PORT", None)) + tracker_port = os.environ.get("TVM_TRACKER_PORT", None) if not tracker_host or not tracker_port: print("Set your AutoTVM tracker node host and port variables to run the autotuner") exit() @@ -213,7 +213,7 @@ def tune_tasks(tasks, reconfig_start = time.time() # Get remote from fleet node - remote = autotvm.measure.request_remote(env.TARGET, tracker_host, tracker_port, timeout=10000) + remote = autotvm.measure.request_remote(env.TARGET, tracker_host, int(tracker_port), timeout=10000) # Reconfigure the JIT runtime and FPGA. # You can program the FPGA with your own custom bitstream diff --git a/vta/scripts/tune_resnet_nnvm.py b/vta/scripts/tune_resnet_nnvm.py index 22a4dd5dfc78..d95ef4320046 100644 --- a/vta/scripts/tune_resnet_nnvm.py +++ b/vta/scripts/tune_resnet_nnvm.py @@ -181,7 +181,7 @@ def tune_tasks(tasks, # Get tracker info from env tracker_host = os.environ.get("TVM_TRACKER_HOST", None) - tracker_port = int(os.environ.get("TVM_TRACKER_PORT", None)) + tracker_port = os.environ.get("TVM_TRACKER_PORT", None) if not tracker_host or not tracker_port: print("Set your AutoTVM tracker node host and port variables to run the autotuner") exit() @@ -209,7 +209,7 @@ def tune_tasks(tasks, 'measure_option': autotvm.measure_option( builder=autotvm.LocalBuilder(build_func=vta.vta_autotvm_build_func), - runner=autotvm.RPCRunner(env.TARGET, tracker_host, tracker_port, + runner=autotvm.RPCRunner(env.TARGET, tracker_host, int(tracker_port), number=4, repeat=3, timeout=60, check_correctness=True)) } diff --git a/vta/tutorials/frontend/deploy_resnet_on_vta.py b/vta/tutorials/frontend/deploy_resnet_on_vta.py index 550dac7caab6..393574932841 100644 --- a/vta/tutorials/frontend/deploy_resnet_on_vta.py +++ b/vta/tutorials/frontend/deploy_resnet_on_vta.py @@ -95,7 +95,7 @@ # To set up the tracker, you'll need to follow the "Auto-tuning # a convolutional network for VTA" tutorial. tracker_host = os.environ.get("TVM_TRACKER_HOST", None) - tracker_port = int(os.environ.get("TVM_TRACKER_PORT", None)) + tracker_port = os.environ.get("TVM_TRACKER_PORT", None) # Otherwise if you have a device you want to program directly from # the host, make sure you've set the variables below to the IP of # your board. @@ -104,7 +104,7 @@ if not tracker_host or not tracker_port: remote = rpc.connect(device_host, device_port) else: - remote = autotvm.measure.request_remote(env.TARGET, tracker_host, tracker_port, timeout=10000) + remote = autotvm.measure.request_remote(env.TARGET, tracker_host, int(tracker_port), timeout=10000) # Reconfigure the JIT runtime and FPGA. # You can program the FPGA with your own custom bitstream