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.17k stars 310 forks source link

Error building PyArmNN #562

Closed bhahn2004 closed 3 years ago

bhahn2004 commented 3 years ago

I had come across to a similar issue in https://github.com/ARM-software/armnn/issues/542. Therefore, I am trying to build PyArmNN on commit hash 0176fd81

I was able to successfully build ArmNN. However, while building PyArmNN whl file, I met the following issue:

After I run python swig_generate.py -v I got:

Generating wrap for armnn_version ...
Generating wrap for armnn ...
/home/pi/armnn-pi/armnn/python/pyarmnn/src/pyarmnn/swig/modules/armnn_types.i:114: Error: Unable to find 'ProfilingGuid.hpp'
Traceback (most recent call last):
  File "swig_generate.py", line 115, in <module>
    generate_wrap(n, f"-I{' -I'.join(armnn_includes)} ")
  File "swig_generate.py", line 90, in generate_wrap
    raise RuntimeError(f"Failed to generate {name} ext.")
RuntimeError: Failed to generate armnn ext.

This seems to be due to commit 7dcc6971

Can somebody help me overcome this error?

bhahn2004 commented 3 years ago

I have built ArmNN with the following versions of dependencies Google Protobuf: 3.12.0 Boost Library: 1.64.0 Arm Compute Library: 21.02 TensorFlow: 2.3.1 Flatbuffer: 1.12.0 ONNX: 1.6.0

For PyArmNN, I used SWIG v4.0.2.

FrancisMurtagh-arm commented 3 years ago

Hi @bhahn2004,

Have you set the environment variables as mentioned in armnn/python/pyarmnn/README.md?

$ export SWIG_EXECUTABLE=<path_to_swig>
$ export ARMNN_INCLUDE=<path_to_armnn_include>             
# ARMNN_INCLUDE should point to armnn/include,armnn/profiling/common/include   
# This is due to paths being split with comma:  armnn_include_path = armnn_include_path_raw.split(",")
$ export ARMNN_LIB=<path_to_armnn_libraries>

Regards, Francis.

bhahn2004 commented 3 years ago

@FrancisMurtagh-arm Thanks. Is it possible that both armnn/include and armnn/profiling/common/include should be included in the python/pyarmnn/README.md with the fact that it should be delimited by ,. Many documentations scattered across the web (results from Google) would just include armnn/include most of the time and make people doubt whether including some things deep down in the directory is a correct thing. I think it would be nice if this is reflected.

Anyways thank you for the solution!

FrancisMurtagh-arm commented 3 years ago

Hi @bhahn2004,

I added a patch for your suggestions, but changed delimiter to : as its standard in Linux: https://review.mlplatform.org/c/ml/armnn/+/6097

Thanks, Francis.