Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not compile "default" android app - error while quantize and dequantize network nodes #779

Open
dmytro1977 opened this issue Feb 7, 2023 · 0 comments

Comments

@dmytro1977
Copy link

System information

  • OS Platform and Distribution Linux Ubuntu 20.04
  • NDK version 25.2
  • GCC version 9.4.0
  • MACE version v1.1.1-20-g42ee056f
  • Python version both 2.7 and 3.6
  • Bazel version - not installed
  • Tensorflow 1.8.0, all other dependencies as written in requirements
  • Anaconda is used

Model deploy file (*.yml)

library_name: mobilenet
target_abis: [arm64-v8a]
model_graph_format: code
model_data_format: code
models:
  mobilenet_v1:
    platform: tensorflow
    model_file_path: https://cnbj1.fds.api.xiaomi.com/mace/miai-models/mobilenet-v1/mobilenet-v1-1.0.pb
    model_sha256_checksum: 71b10f540ece33c49a7b51f5d4095fc9bd78ce46ebf0300487b2ee23d71294e6
    subgraphs:
      - input_tensors:
          - input
        input_shapes:
          - 1,224,224,3
        output_tensors:
          - MobilenetV1/Predictions/Reshape_1
        output_shapes:
          - 1,1001
    runtime: cpu+gpu
    limit_opencl_kernel_time: 0
    obfuscate: 0
    winograd: 0
  mobilenet_v2:
    platform: tensorflow
    model_file_path: https://cnbj1.fds.api.xiaomi.com/mace/miai-models/mobilenet-v2/mobilenet-v2-1.0.pb
    model_sha256_checksum: 369f9a5f38f3c15b4311c1c84c032ce868da9f371b5f78c13d3ea3c537389bb4
    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
    obfuscate: 0
    winograd: 0
  mobilenet_v1_quant:
    platform: tensorflow
    model_file_path: http://cnbj1.fds.api.xiaomi.com/mace/miai-models/mobilenet-v1/mobilenet_v1_1.0_224_quant_retrain.pb
    model_sha256_checksum: c3faa9bd790310eb3dec411d2f2e2dd8802394e31ccb47daaa5e3b6369fadfa3
    subgraphs:
      - input_tensors:
          - input
        input_shapes:
          - 1,224,224,3
        input_ranges:
          - -1.0,1.0
        output_tensors:
          - MobilenetV1/Predictions/Softmax:0
        output_shapes:
          - 1,1001
    runtime: cpu
    limit_opencl_kernel_time: 0
    obfuscate: 0
    winograd: 0
    quantize: 1
  mobilenet_v2_quant:
    platform: tensorflow
    model_file_path: https://cnbj1.fds.api.xiaomi.com/mace/miai-models/mobilenet-v2/mobilenet_v2_1.0_224_quant_retrain.pb
    model_sha256_checksum: 1429c8e2a91b251c9fa0dae43dfa5817c5a798bd30284f8c0690e7569a8817f1
    subgraphs:
      - input_tensors:
          - input
        input_shapes:
          - 1,224,224,3
        input_ranges:
          - -1.0,1.0
        output_tensors:
          - output
        output_shapes:
          - 1,1001
    runtime: cpu
    limit_opencl_kernel_time: 0
    obfuscate: 0
    winograd: 0
    quantize: 1

Describe the problem

error while quantize and dequantize network nodes

To Reproduce

Steps to reproduce the problem:

1. cd /path/to/mace/examples/android
2. ./build.sh dynamic # also happens for static

Error information / logs

Traceback (most recent call last):
  File "tools/converter.py", line 1333, in <module>
    flags.func(flags)
  File "tools/converter.py", line 925, in convert_func
    convert.convert(configs, MODEL_CODEGEN_DIR, flags.enable_micro)
  File "tools/python/convert.py", line 89, in convert
    net_def_with_Data = convert_net(net_name, net_conf, enable_micro)
  File "tools/python/convert.py", line 238, in convert_net
    output_graph_def, quantize_activation_info = mace_transformer.run()
  File "tools/python/transform/transformer.py", line 175, in run
    changed = transformer()
  File "tools/python/transform/transformer.py", line 1962, in quantize_nodes
    self._quantize_activation_info[op.output[i]]
KeyError: 'output'



### Additional context
Looks like the dictionary key 'output' is absent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant