quic / ai-hub-models

The Qualcomm® AI Hub Models are a collection of state-of-the-art machine learning models optimized for performance (latency, memory etc.) and ready to deploy on Qualcomm® devices.
https://aihub.qualcomm.com
BSD 3-Clause "New" or "Revised" License
438 stars 60 forks source link

No such file or directory: '/opt/qcom/aistack/qairt/2.21.0.240401/lib/android/qtld-release.aar' #33

Closed fangxingSR closed 6 months ago

fangxingSR commented 6 months ago

ai-hub-models-main\apps\android\ImageClassification\classification

Traceback (most recent call last): File "build_apk.py", line 119, in shutil.copy(aarfile, destaar) File "/usr/lib/python3.8/shutil.py", line 418, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '/opt/qcom/aistack/qairt/2.21.0.240401/lib/android/qtld-release.aar'

To Reproduce Steps to reproduce the behavior:

  1. Go to : ai-hub-models-main\apps\android\ImageClassification\classification
  2. ' python build_apk.py -q $QNN_SDK_PATH -m mobilenet_v3_large'
  3. Do you want us to download the model from AI hub (y/n)n
  4. Click on 'N' 5.Give model File as input./mobilenet_v3.tflite
  5. Traceback (most recent call last): File "build_apk.py", line 119, in shutil.copy(aarfile, destaar) File "/usr/lib/python3.8/shutil.py", line 418, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '/opt/qcom/aistack/qairt/2.21.0.240401/lib/android/qtld-release.aar'

Host configuration:

fangxingSR commented 6 months ago

/opt/qcom/aistack/qairt/2.21.0.240401/lib/android$ ls platform-validator.aar psnpe-release.aar snpe-release.aar

fangxingSR commented 6 months ago

Under this path: ai-hub-models-main/apps/android/ImageClassification/classification/src/main/assets Can be successfully copied out:classification.tflite

/ai-hub-models-main/apps/android/ImageClassification/build_apk.py The 114th line of the code

# copy qtld-release.aar to $test_app_root/Application/
destaar = os.path.join(".", "classification", "libs")
if not os.path.exists(destaar):
    os.makedirs(destaar)
aarfile = os.path.join(args.qnnsdk, "lib", "android", "qtld-release.aar")
shutil.copy(aarfile, destaar)

Another project also relies on qtld release. aar

fangxingSR commented 6 months ago

It's solved, it's a permission issue. Thanks to everyone in the Qualcomm AI Hub channel, I got the following information to solve the problem, qpm-cli --license-activate qualcomm_ai_engine_direct qpm-cli --extract qualcomm_ai_engine_direct qtld-release.aar was successfully obtained.

mestrona-3 commented 6 months ago

Awesome, glad the community was able to help solve this issue!

ZhangWeiOneTwo commented 5 months ago

Hello! Can you help me? When I execute the qpm-cli --extract qualcomm_ai_engine_direct command, it returns directly.

fangxingSR commented 5 months ago

Hello! Can you help me? When I execute the qpm-cli --extract qualcomm_ai_engine_direct command, it returns directly.


Firstly, Qualcomm's relevant agreements must be filled out

https://www.qualcomm.com/agreements

To ensure that QPM3 is installed and has passed Qualcomm's security review,

The data is copied from the qpm3 download page of the official website: Install QPM3 from https://qpm.qualcomm.com/#/main/tools/details/QPM3 In the terminal, run the following command:

  1. qpm-cli --login
  2. qpm-cli --license-activate qualcomm_ai_engine_direct
  3. qpm-cli -- extract qualcomm_ai_engine_direct (or) qpm-cli --extract < the full path to the downloaded .qik file> (or) From the QPM3 desktop app:
  4. Open the QPM3 app on your desktop
  5. Go to the Tools page and select Qualcomm® AI Engine Direct SDK
ZhangWeiOneTwo commented 5 months ago

After executing the Give model File as input./moblenet_v3.tflite step, report the following error and how to fix it。 error: ' python build_apk.py -q $QNN_SDK_PATH -m mobilenet_v3_large' Do you want us to download the model from AI hub (y/n)n Give model File as input./moblenet_v3.tflite ./moblenet_v3.tflite PATH DO NOT EXIST: ./moblenet_v3.tflite

mestrona-3 commented 5 months ago

Hi @ZhangWeiOneTwo, as mentioned previously the QNNDelegate can be accessed here https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-apps/qnn/linux/2.20.0.240223.zip. It seems like the other error you have pasted above is in relation to not having mobile net_v3 saved / saved in a reference-able location. If you continue to hit issues, please open a new GitHub issue or post in slack, as this issue is closed.

fangxingSR commented 5 months ago

After executing the Give model File as input./moblenet_v3.tflite step, report the following error and how to fix it。 error: ' python build_apk.py -q $QNN_SDK_PATH -m mobilenet_v3_large' Do you want us to download the model from AI hub (y/n)n Give model File as input./moblenet_v3.tflite ./moblenet_v3.tflite PATH DO NOT EXIST: ./moblenet_v3.tflite

Indeed, you need to reopen a post to discuss new issues. Okay, I'll write a complete process article and post it on some forums or blogs. It may be slower for about one or two days.

ZhangWeiOneTwo commented 5 months ago

It's solved, I got the following information to solve the problem, thanks.