ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.14k stars 307 forks source link

ERROR: Operator FULLY_CONNECTED is not supported by armnn_delegate. #678

Closed luchangli03 closed 1 year ago

luchangli03 commented 1 year ago

ERROR: Operator FULLY_CONNECTED is not supported by armnn_delegate.

ArmRyan commented 1 year ago

Hi @luchangli03

Can you provide any more details on the issue? Such as: ArmNN Version, ACL version, TfLite version, System OS, what device is being used, Model information ( can you link the model? ) How are you running the delegate?

Regards, Ryan

kylesayrs commented 1 year ago

I also encountered this message and failed to run my transformers model with tflite

ArmNN version: ArmNN v29.0.0, prebuilt binaries for x86 ACL version: Not downloaded TfLite version: tensorflow == 2.10.0rc0 System OS: Linux Device: Graviton gen 1 (ec2 a1) Model download: BERT QA. Also found here: https://www.tensorflow.org/lite/examples/bert_qa/overview

This seems to be an issue with CpuAcc, as removing it from the list of backends fixes the warnings and errors.

Attempting to instantiate the interpreter

delegates = (
            [
                tflite_runtime.interpreter.load_delegate(
                    library=delegate_lib_path,
                    options={"backends": "CpuAcc,CpuRef", "logging-severity": "debug"},
                )
            ]
            if delegate_lib_path
            else None
        )

interpreter = tflite_runtime.interpreter.Interpreter(
            model_path=model_path, experimental_delegates=delegates,
        )

Which leads to the following outputs:

WARNING: FULLY_CONNECTED: not supported by armnn
WARNING: TRANSPOSE: not supported by armnn: in validate_arguments src/cpu/kernels/CpuPermuteKernel.cpp
:113: Objects have different dimensions
Info: ArmnnSubgraph creation
Info: Parse nodes to ArmNN time: 26.52 ms
Warning: WARNING: Layer of type Gather is not supported on requested backend CpuAcc for input data type Float32 and output data type Float32 (reason: in validate_arguments src/core/NEON/kernels/NEGatherKernel.cpp:59: indices->num_dimensions() > 1), falling back to the next backend.
Warning: WARNING: Layer of type Gather is not supported on requested backend CpuAcc for input data type Float32 and output data type Float32 (reason: in validate_arguments src/core/NEON/kernels/NEGatherKernel.cpp:59: indices->num_dimensions() > 1), falling back to the next backend.
Warning: WARNING: Layer of type Transpose is not supported on requested backend CpuAcc for input data type Float32 and output data type Float32 (reason: in validate_arguments src/cpu/kernels/CpuPermuteKernel.cpp:113: Objects have different dimensions), falling back to the next backend.
Warning: WARNING: Layer of type Transpose is not supported on requested backend CpuAcc for input data type Float32 and output data type Float32 (reason: in validate_arguments src/cpu/kernels/CpuPermuteKernel.cpp:113: Objects have different dimensions), falling back to the next backend.
Warning: WARNING: Layer of type Transpose is not supported on requested backend CpuAcc for input data type Float32 and output data type Float32 (reason: in validate_arguments src/cpu/kernels/CpuPermuteKernel.cpp:113: Objects have different dimensions), falling back to the next backend.
Info: Optimize ArmnnSubgraph time: 8.07 ms
python3: /build/armnn-YyCEBh/armnn-22.05.01/src/armnn/LoadedNetwork.cpp:653: const armnn::IWorkloadFactory& armnn::LoadedNetwork::GetWorkloadFactory(const armnn::Layer&) const: Assertion `(IWorkloadFactory::IsLayerSupported(layer, {}, reasonIfUnsupported, m_OptimizedNetwork->pOptimizedNetworkImpl->GetModelOptions())) && "Factory does not support layer"' failed.
Aborted (core dumped)
ArmRyan commented 1 year ago

Hi @kylesayrs , CpuAcc requires ACL library to work. Is it possible to include ACL 22.05 in your build?