caffe-android-demo
caffe-android-demo copied to clipboard
File not found on Xiaomi6, Android7.1.1, the solution in issue41 doesn't work
Crashed in Xiaomi-6. The same problem in issue41 was solved. Although I adopt the this solution, allowing the permission of caffe-android-demo, the error still exists.
And the build.gradle is compileSdkVersion 25 buildToolsVersion "25.0.1" defaultConfig { applicationId "com.sh1r0.caffe_android_demo" minSdkVersion 21 targetSdkVersion 25 versionCode 1 versionName "1.0" }
Hello~ Do you solve this problem ? I meet the same problem.
I got root privilege, problem solved
Excuse me , Have another solution?
I think you should make it clear why "File not found". For my mobile phone, although I have opened the permission for the app in Setting, without root permission, file still cannot be access.
If running on Android >= 6.0, you should be granting permissions in the code in addition to the manifest.
Before you attempt to read the files, you need something like below. It's not perfect but it will check for the required permissions and log the result to console (0 for ok, -1 for not ok). It will also request the permissions from the user.
int permissionCheckStorage = ContextCompat.checkSelfPermission(this.getApplicationContext(),
Manifest.permission.WRITE_EXTERNAL_STORAGE);
Log.d(LOG_TAG, "permissionCheck WRITE_EXTERNAL_STORAGE = " + permissionCheckStorage);
int permissionCheckCamera = ContextCompat.checkSelfPermission(this.getApplicationContext(),
Manifest.permission.CAMERA);
Log.d(LOG_TAG, "permissionCheck CAMERA = " + permissionCheckCamera);
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA},
MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE_AND_CAMERA);
My cellphone is Android 7.0 and API 24. I have checked the permission .Both camera and external storage have gotten the permission. But it doesn't work . Check failed: fd != -1 (-1 vs. -1) File not found: /storage/emulated/0/caffe_mobile/bvlc_reference_caffenet/deploy.prototxt
And I find something in this project ,like below.Is it an error?
I've successfully run this demo both on cpu-mode and gpu-mode, the error you displayed above always exists. When running, it would call JNI functions packaged in dynamic library. Check the path and acquire root permission.