Skip to content

Commit

Permalink
Fix wrong path in validate_onnx.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed May 13, 2019
1 parent 896065b commit 4150702
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validate_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ def run(input_arrs, daq, dnn_retrieve_result, quant_input=False, quant_output=Fa
np.savetxt(input_txt, nhwc_input.flatten(), delimiter='\n')
input_txts.append(input_txt)
input_txts_arg = " ".join(input_txts)
input_txts_in_android_arg = " ".join(map(lambda x: "/data/local/tmp/" + x, input_txts))

txt = os.path.join(tempfile._get_default_tempdir(), next(tempfile._get_candidate_names()))
os.system("adb push {} /data/local/tmp/".format(input_txts_arg))
os.system("adb push {} /data/local/tmp/dnn_retrieve_result".format(dnn_retrieve_result))
os.system('adb shell "LD_LIBRARY_PATH=/data/local/tmp/ /data/local/tmp/dnn_retrieve_result /data/local/tmp/{} {} {} {}"'.format(os.path.basename(daq), "--quant_input" if quant_input else "", "--quant_output" if quant_output else "", " ".join(map(lambda x: "/data/local/tmp/" + x, input_txts))))
os.system("adb shell rm {}".format(input_txts_arg))
os.system('adb shell "LD_LIBRARY_PATH=/data/local/tmp/ /data/local/tmp/dnn_retrieve_result --nchw_result /data/local/tmp/{} {} {} {}"'.format(os.path.basename(daq), "--quant_input" if quant_input else "", "--quant_output" if quant_output else "", input_txts_in_android_arg))
os.system("adb shell rm {}".format(input_txts_in_android_arg))
os.system("adb shell rm /data/local/tmp/dnn_retrieve_result")
os.system("adb pull /data/local/tmp/result {}".format(txt))
os.system("adb shell rm /data/local/tmp/result")
Expand Down

0 comments on commit 4150702

Please sign in to comment.