我遵循高通神经处理引擎教程以构建示例应用程序。
当应用程序加载模型发生错误时。错误消息以下
09-01 12:21:20.600 30650-30681/com.qualcomm.qti.snpe.imageclassifiers E/LoadNetworkTask: Unable to create network! Cause: error_code=307; error_message=Model record is missing in dlc. Missing mandatory record model; error_component=Dl Container; line_no=447; thread_id=-1422036112
java.lang.IllegalStateException: Unable to create network! Cause: error_code=307; error_message=Model record is missing in dlc. Missing mandatory record model; error_component=Dl Container; line_no=447; thread_id=-1422036112
at com.qualcomm.qti.snpe.internal.NativeNetwork.nativeInitFromFile(Native Method)
at com.qualcomm.qti.snpe.internal.NativeNetwork.<init>(NativeNetwork.java:90)
at com.qualcomm.qti.snpe.SNPE$NeuralNetworkBuilder.build(SNPE.java:214)
at com.qualcomm.qti.snpe.imageclassifiers.tasks.LoadNetworkTask.doInBackground(LoadNetworkTask.java:50)
at com.qualcomm.qti.snpe.imageclassifiers.tasks.LoadNetworkTask.doInBackground(LoadNetworkTask.java:20)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
如何解决此问题?
求解的顺序如下:
1)如https://developer.qualcomm.com/software/snapdragon-neural-processing-engine-eengine-ai/getting-started of https://developer.qualcomm.com/software/snapdraware-compom
1)下载并打包Alexnet模型 具体,您需要:
cd $SNPE_ROOT/examples/android/image-classifiers
cp ../../../android/snpe-release.aar ./app/libs # copies the NPE runtime library
bash ./setup_models.sh
2)之后,您可能会遇到此问题:https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-neural-processing-engine-sdk/35375
/raw_alexnet.zip.flat: error: failed to read data meta data.
要解决此问题,您可以在此处首先使用旁路(Android Studio"错误:在更新为3.0.0之后),因为这是AAPT2
的持续错误3)如果仍未解决,请使用ADB Shell验证所有文件都在Android设备上:
adb shell
sifiers/files $ ls -R /storage/emulated/0/Android/data/com.qualcomm.qti.snpe.i>ssifiers/files $
/storage/emulated/0/Android/data/com.qualcomm.qti.snpe.imageclassifiers/files/models/:
alexnet
/storage/emulated/0/Android/data/com.qualcomm.qti.snpe.imageclassifiers/files/models//alexnet:
images
/storage/emulated/0/Android/data/com.qualcomm.qti.snpe.imageclassifiers/files/models//alexnet/images:
shell@msm8996:/storage/emulated/0/Android/data/com.qualcomm.qti.snpe.imageclassifiers/files $
我们在这里可以看到的是:问题是SNPE搜索不在正确位置的文件,因此您可以将目录移至正确的位置
cd /storage/emulated/0/Android/data/
mv com.qualcomm.qti.snpe.imageclassifiers com.qualcomm.qti.snpe
b。目录是空的 - 因此您可以将预期数据推到正确的位置: 只需将其提取到某些目录,并从目录中提取:
adb push ./ /storage/emulated/0/Android/data/com.qualcomm.qti.snpe/files/models/alexnet/
它应该起作用。