XiaoMi / mace

MACE is a deep learning inference framework optimized for mobile heterogeneous computing platforms.
Apache License 2.0
4.93k stars 819 forks source link

yml file output shape is not mace mace_run.cc output shape #427

Closed TChallaLiu closed 5 years ago

TChallaLiu commented 5 years ago

Before you open an issue, please make sure you have tried the following steps:

  1. Make sure your environment is the same with (https://mace.readthedocs.io/en/latest/installation/env_requirement.html).
  2. Have you ever read the document for your usage?
  3. Check if your issue appears in HOW-TO-DEBUG or FAQ.
  4. The form below must be filled.

System information

Model deploy file (*.yml)

library_name: mobilenet_v2_1_0_224
target_abis: [armeabi-v7a, arm64-v8a]
model_graph_format: file
model_data_format: file
models:
  mobilenet_v2_1_0_224:
    platform: tensorflow
    model_file_path: /home/cy/mace/mace-models/moblienet-v2_1.0_244/mobilenet_v2_1.0_224_frozen.pb
    model_sha256_checksum: 83083557df00366b58837a396c1ca3bc0bc4c1f421d9e95e0318afc4a50ad7c5
    subgraphs:
      - input_tensors:
          - input
        input_shapes:
          - 1,224,224,3
        output_tensors:
          - MobilenetV2/Predictions/Reshape_1
        output_shapes:
          - 1, 1001
    runtime: cpu+gpu
    limit_opencl_kernel_time: 0
    nnlib_graph_mode: 0
    obfuscate: 0
    winograd: 0

Describe the problem

the output shape(1,1001) which define in yml file is not mace mace_run.cc output shape (1). see the log as below.

To Reproduce

Steps to reproduce the problem:

1. cd /path/to/mace
2. python tools/converter.py run --config=/home/cy/mace/mace-models/moblienet-v2_1.0_244/mobilenet_v2_1.0_224_frozen.yml

Error information / logs

Please include the full log and/or traceback here.

cy@cy-pc:~/mace/mace2$ python tools/converter.py run --config=/home/cy/mace/mace-models/moblienet-v2_1.0_244/mobilenet_v2_1.0_224_frozen.yml* Build //mace/tools/validation:mace_run_static with ABI armeabi-v7a
WARNING: Duplicate rc file: /home/cy/mace/mace2/tools/bazel.rc is read multiple times, most recently imported from /home/cy/mace/mace2/.bazelrc
WARNING: Processed legacy workspace file /home/cy/mace/mace2/tools/bazel.rc. This file will not be processed in the next release of Bazel. Please read https://github.com/bazelbuild/bazel/issues/6319 for further information, including how to upgrade.
Starting local Bazel server and connecting to it...
v0.10.0-227-g7d3849a
Generate OpenCL kernel done.
INFO: Analysed target //mace/tools/validation:mace_run_static (32 packages loaded).
INFO: Found 1 target...
INFO: From Executing genrule @opencl_clhpp//:gen_opencl_clhpp:
/tmp/opencl-clhpp-build.7nazKyQX07 /home/cy/.cache/bazel/_bazel_cy/ce6c7c670d1b6bbbb5978784a6c5a8af/sandbox/linux-sandbox/163/execroot/mace
/tmp/opencl-clhpp-build.7nazKyQX07/build /tmp/opencl-clhpp-build.7nazKyQX07 /home/cy/.cache/bazel/_bazel_cy/ce6c7c670d1b6bbbb5978784a6c5a8af/sandbox/linux-sandbox/163/execroot/mace
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/opencl-clhpp-build.7nazKyQX07/build
Scanning dependencies of target generate_clhpp
[100%] Rebuilding cl.hpp ...
[100%] Built target generate_clhpp
Scanning dependencies of target generate_cl2hpp
[100%] Rebuilding cl2.hpp ...
[100%] Built target generate_cl2hpp
/tmp/opencl-clhpp-build.7nazKyQX07 /home/cy/.cache/bazel/_bazel_cy/ce6c7c670d1b6bbbb5978784a6c5a8af/sandbox/linux-sandbox/163/execroot/mace
/home/cy/.cache/bazel/_bazel_cy/ce6c7c670d1b6bbbb5978784a6c5a8af/sandbox/linux-sandbox/163/execroot/mace
installing to bazel-out/armeabi-v7a-opt/genfiles/external/opencl_clhpp
Target //mace/tools/validation:mace_run_static up-to-date:
  bazel-bin/mace/tools/validation/mace_run_static
INFO: Elapsed time: 206.872s, Critical Path: 21.41s
INFO: 350 processes: 350 linux-sandbox.
INFO: Build completed successfully, 369 total actions
Build done!

**********************************************************
          Run model mobilenet_v2_1_0_224 on MI5s
**********************************************************

Generate input file:  builds/mobilenet_v2_1_0_224/_tmp/mobilenet_v2_1_0_224/3252ee9d10e8c91f54fa82acd272ff29/MI5s_msm8996/armeabi-v7a/model_input_input
Generate input file done.
* Run 'mobilenet_v2_1_0_224' with round=1, restart_round=1, tuning=False, out_of_range_check=False, omp_num_threads=(-1,), cpu_affinity_policy=(1,), gpu_perf_hint=(3,), gpu_priority_hint=(3,)
Push builds/mobilenet_v2_1_0_224/_tmp/mobilenet_v2_1_0_224/3252ee9d10e8c91f54fa82acd272ff29/MI5s_msm8996/armeabi-v7a/model_input_input to /data/local/tmp/mace_run
Push builds/mobilenet_v2_1_0_224/model/mobilenet_v2_1_0_224.data to /data/local/tmp/mace_run
Push builds/mobilenet_v2_1_0_224/model/mobilenet_v2_1_0_224.pb to /data/local/tmp/mace_run/mobilenet_v2_1_0_224.pb
Push builds/mobilenet_v2_1_0_224/_tmp/armeabi-v7a/mace_run_static to /data/local/tmp/mace_run
Push /tmp/cmd_file-mobilenet_v2_1_0_224-1555484664.8 to /data/local/tmp/mace_run/cmd_file-mobilenet_v2_1_0_224-1555484664.8
WARNING: linker: Warning: unable to normalize "external/androidndk/ndk/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/5.0.300080/lib/linux/arm"
I mace/tools/validation/mace_run.cc:434] model name: mobilenet_v2_1_0_224
I mace/tools/validation/mace_run.cc:435] mace version: v0.10.0-227-g7d3849a
I mace/tools/validation/mace_run.cc:436] input node: input
I mace/tools/validation/mace_run.cc:437] input shape: 1,224,224,3
I mace/tools/validation/mace_run.cc:438] output node: MobilenetV2/Predictions/Reshape_1
I mace/tools/validation/mace_run.cc:439] output shape: 1,
I mace/tools/validation/mace_run.cc:440] input_file: /data/local/tmp/mace_run/model_input
I mace/tools/validation/mace_run.cc:441] output_file: /data/local/tmp/mace_run/model_out
I mace/tools/validation/mace_run.cc:442] model_data_file: /data/local/tmp/mace_run/mobilenet_v2_1_0_224.data
I mace/tools/validation/mace_run.cc:443] model_file: /data/local/tmp/mace_run/mobilenet_v2_1_0_224.pb
I mace/tools/validation/mace_run.cc:444] device: CPU
I mace/tools/validation/mace_run.cc:445] round: 1
I mace/tools/validation/mace_run.cc:446] restart_round: 1
I mace/tools/validation/mace_run.cc:447] gpu_perf_hint: 3
I mace/tools/validation/mace_run.cc:448] gpu_priority_hint: 3
I mace/tools/validation/mace_run.cc:449] omp_num_threads: -1
I mace/tools/validation/mace_run.cc:450] cpu_affinity_policy: 1
I mace/libmace/mace.cc:426] Creating MaceEngine, MACE version: v0.10.0-227-g7d3849a
I mace/libmace/mace.cc:458] Initializing MaceEngine
I mace/libmace/mace.cc:571] Destroying MaceEngine
I mace/tools/validation/mace_run.cc:487] restart round 0
I mace/libmace/mace.cc:830] Create MaceEngine from model graph proto and weights data
I mace/libmace/mace.cc:426] Creating MaceEngine, MACE version: v0.10.0-227-g7d3849a
I mace/libmace/mace.cc:458] Initializing MaceEngine
I mace/tools/validation/mace_run.cc:256] Create Mace Engine latency: 47.936 ms
I mace/tools/validation/mace_run.cc:263] Total init latency: 48.367 ms
I mace/tools/validation/mace_run.cc:304] Warm up run
F mace/libmace/mace.cc:711] Check failed: output_size <= output->second.impl_->buffer_size Output size exceeds buffer size: shape[1, 1001, 1] vs buffer size 1
F mace/libmace/mace.cc:711] backtrace:
F mace/libmace/mace.cc:711]  pc 0xb0ff9ffa
F mace/libmace/mace.cc:711]  pc 0xb0ffc36c
F mace/libmace/mace.cc:711]  pc 0xb0ffc2de
F mace/libmace/mace.cc:711]  pc 0xb0ffc71c
F mace/libmace/mace.cc:711]  pc 0xb0ffc836
F mace/libmace/mace.cc:711]  pc 0xb0e7d4ca
F mace/libmace/mace.cc:711]  pc 0xb0e7ec68
F mace/libmace/mace.cc:711]  pc 0xb0e7f40c
F mace/libmace/mace.cc:711]  pc 0xb0e60bfa
F mace/libmace/mace.cc:711]  pc 0xb0e62b20
F mace/libmace/mace.cc:711]  pc 0xb0e63728
F mace/libmace/mace.cc:711]  pc 0xe8fd6976 __libc_init
Aborted
ERROR: [Mace Run] /home/cy/mace/mace2/tools/device.py:357: Mace run failed.

Additional context

Add any other context about the problem here, e.g., what you have modified about the code.

lee-bin commented 5 years ago

Would you try removing the space before 1001?

TChallaLiu commented 5 years ago

oh, it solved...