XiaoMi / mobile-ai-bench

Benchmarking Neural Network Inference on Mobile Devices
Apache License 2.0
353 stars 57 forks source link

Error: Build did NOT complete successfully #37

Closed labsurde closed 4 years ago

labsurde commented 4 years ago

Hi.

I am experiencing this error. Could you please help?

Error screen

$ bash tools/benchmark.sh --benchmark_option=Performance --executor=TFLITE --target_abis=arm64-v8a
Starting local Bazel server and connecting to it...
........
INFO: Analysed target //aibench/python:benchmark (18 packages loaded).
INFO: Found 1 target...
Target //aibench/python:benchmark up-to-date:
  bazel-bin/aibench/python/benchmark
INFO: Elapsed time: 2.222s, Critical Path: 0.04s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
Find qualcomm adb device:711KPCA0776611
No Arm linux device yaml file
Prepare to run models on arm64-v8a
Push output/benchmark.pb to /data/local/tmp/aibench
Push output/model.pb to /data/local/tmp/aibench
Push output/TF_IV3_03.toco.tflite to /data/local/tmp/aibench
libhexagon_nn_skel.so does not exists, QualcommAdbDevice Skip DSP.
* Build //aibench/benchmark:model_benchmark for TFLITE with ABI arm64-v8a
WARNING: The following configs were expanded more than once: [cross_compile]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
ERROR: build interrupted
INFO: Elapsed time: 56.532s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (8 packages loaded)
Traceback (most recent call last):
  File "/home/eric/src/mobile-ai-bench/bazel-bin/aibench/python/benchmark.runfiles/aibench/aibench/python/benchmark.py", line 354, in <module>
    main(unused_args=[sys.argv[0]] + unparsed)
  File "/home/eric/src/mobile-ai-bench/bazel-bin/aibench/python/benchmark.runfiles/aibench/aibench/python/benchmark.py", line 343, in main
    benchmark_option, benchmark_list, result_files,)
  File "/home/eric/src/mobile-ai-bench/bazel-bin/aibench/python/benchmark.runfiles/aibench/aibench/python/benchmark.py", line 261, in run_on_device
    avail_device_types)
  File "/home/eric/src/mobile-ai-bench/aibench/python/bench_engine.py", line 117, in bazel_build
    *bazel_args)
  File "/home/eric/.local/lib/python2.7/site-packages/sh.py", line 1413, in __call__
    raise exc
sh.ErrorReturnCode_8: 

  RAN: /home/eric/src/mobile-ai-bench/bazel build //aibench/benchmark:model_benchmark --config android --cpu=arm64-v8a --action_env=ANDROID_NDK_HOME=/home/eric/dev/android-ndk-r16b/ --define tflite=true

  STDOUT:

  STDERR:

The line that throws an exception is in sh.py:

        if call_args["fg"]:
            if call_args["env"] is None:
                launch = lambda: os.spawnv(os.P_WAIT, cmd[0], cmd)
            else:
                launch = lambda: os.spawnve(os.P_WAIT, cmd[0], cmd, call_args["env"])

            exit_code = launch()
            exc_class = get_exc_exit_code_would_raise(exit_code,
                    call_args["ok_code"], call_args["piped"])
            if exc_class:
                if IS_PY3:
                    ran = " ".join([arg.decode(DEFAULT_ENCODING, "ignore") for arg in cmd])
                else:
                    ran = " ".join(cmd)
                exc = exc_class(ran, b"", b"", call_args["truncate_exc"])
                raise exc    --------------------------> exception
            return None

Could you please help to solve this issue?

and.. one more question is... could you let me know where I can get or how I can create imagenet_less.zip?

Thanks a lot!

lee-bin commented 4 years ago

bazel build command needs to download the required packages in WORKSPACE. It looks like that you could not download opencv as it's a customized version only downloadable from https://cnbj1.fds.api.xiaomi.com. So, can you access Google Drive? Maybe I can upload it there for you to access. imagenet_less.zip is the first 1000 images from imagenet 2012 validation set.

labsurde commented 4 years ago

That will be amazing. Could you please upload opencv and let me know? Thank you so much.

lee-bin commented 4 years ago

opencv imagenet_less.zip

labsurde commented 4 years ago

@lee-bin, I downloaded both files. I will try to build with the files. Again, thank you so much for your time and consideration!

labsurde commented 4 years ago

With the file you shared, the above issue seemed to be solved. Let me close this issue.

One other thing is that now I got another error: ERROR: missing input file '//third_party/tflite:tensorflow/lite/lib/arm64-v8a/libtensorflowLite.so'

Since URL of zipped tensorflow in config.yml is not accessible, I put zipped source code of Tensorflow into the URL of config.yml but maybe the tensorflow zip file needs to contain libtensorflowLite.so, I guess. I will try that next week. :-)