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.15k stars 307 forks source link

Error while importing pyarmnn #599

Closed Tyogi closed 2 years ago

Tyogi commented 2 years ago

I am getting Your ArmNN library instance does not support Onnx models parser functionality. Skipped IOnnxParser import. 26.0.0 Instead of # Returns '{ARMNN_MAJOR_VERSION}.0.0' e.g. 27.0.0 while executing python3 -c "import pyarmnn as ann;print(ann.GetVersion())". please look into it. Screenshot from 2021-12-07 19-31-53

MikeJKelly commented 2 years ago

Hi @Tyogi

Your ArmNN library instance does not support Onnx models parser functionality. Skipped IOnnxParser import.

Is just a warning that ArmNN was built without Onnx parser support, the ArmNN version is printed on the next line: 26.0.0

Best regards, Mike

Tyogi commented 2 years ago

can I continue or should I do anything else. While I am executing sudo apt-get install -y armnn-latest-cpu I am getting error saying: Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package armnn-latest-cpu

MikeJKelly commented 2 years ago

It should be OK to continue with it.

If apt-get can't find the armnn-latest-cpu package then you might need to use these commands:

sudo add-apt-repository ppa:armnn/ppa
sudo apt update

Then run sudo apt-get install -y armnn-latest-cpu Then it should work!

Tyogi commented 2 years ago

Yes, I executed those commands but still not working.

MikeJKelly commented 2 years ago

Try sudo apt-get install -y armnn-latest-all and see what it installs, on my x86 dev machine I see the following:

The following additional packages will be installed:
  libarmnn-cpuref-backend26 libarmnn26 libarmnntfliteparser24 libflatbuffers1

armnn-latest-cpu will only work on a machine that as an Arm CPU.

Tyogi commented 2 years ago

I am using intel what should I do now should I skip these commands are their any other commands

MikeJKelly commented 2 years ago

If you're running on Intel then the commands that you have already run (sudo apt-get install -y python3-pyarmnn armnn-latest-all) should be enough to get armnn to work. You will be able to use the reference backend on intel but it may be quite slow.

Are you following a guide? If you are and the guide says to specify the backend to use by using --preferred_backends CpuAcc CpuRef , for example, then you will have to use --preferred_backends CpuRef instead but then the example should still work.

Tyogi commented 2 years ago

Yes,I am following https://github.com/ARM-software/armnn/blob/branches/armnn_21_11/InstallationViaAptRepository.md#introduction this guide

Tyogi commented 2 years ago

Hii @MikeJKelly I am Getting an error while executing this cmake $BASEDIR/tensorflow CMake Error: The source directory "/home/yogi/ArmNNDelegate/tensorflow" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. please look into it.

MikeJKelly commented 2 years ago

Hi @Tyogi

are you following a different guide? You shouldn't need to build tensorflow if you've already installed armnn-latest-all (that will have installed libarmnntfliteparser24). What tensorflow version are you using? If you want to build tensorflow with CMake then you will need to download tensorflow version 2.4 or later.

Best regards, Mike

Tyogi commented 2 years ago

Thanks @MikeJKelly for your reply but I am new to this, I am not really understanding what to do. Is their any other way to install armnn like a video or something.Please help me

MikeJKelly commented 2 years ago

Hi @Tyogi

You have successfully installed ArmNN, you can see that because this command:

python3 -c "import pyarmnn as ann;print(ann.GetVersion())"

Returns 26.0.0. So ArmNN has been correctly installed.

What are you trying to do with ArmNN?

Tyogi commented 2 years ago

Hi @MikeJKelly I have to analyse the cpu and GPU performances of a mobile phone and optimize the memory bottleneck.

MikeJKelly commented 2 years ago

Hi @Tyogi

you can download the libraries for Android devices here:

https://github.com/ARM-software/armnn/releases/tag/v21.11

The library to download depends on the version of Android installed and the type of CPU on the mobile phone you're using.

If you want to build the libraries you will need to follow the Android build guide: https://github.com/ARM-software/armnn/blob/branches/armnn_21_11/BuildGuideAndroidNDK.md

Best regards, Mike

catcor01 commented 2 years ago

Hello @Tyogi,

If the primary problem here is due to the failed OnnxParser import when using PyArmNN please look at the following issue for a potential solution: #651.

I am closing this issue as it has not received an update in some time. Please feel free to reopen if your problem still persist.

Kind regards, Cathal.