New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: No OpKernel was registered to support Op 'ExtractImagePatches' #10153
Comments
This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there. |
@CHLLHC @StarRain-L Both of these ops should be included via tensorflow/core:android_op_registrations_and_gradients, which includes array_ops.cc (ExtractImagePatches) and math_ops.cc (Maximum). Can you provide more details about how you are building your app? Does it work if you use the prebuilt binaries? And just to note, selective registration should also not be necessary. |
I just put "extract_image_patches_op.cc" in ./tensorflow/tensorflow/core/kernels/BUILD inside the |
@CHLLHC have you found a solution to this issue? I've made similar attempts to get ExtractImagePatches running on android to no avail. |
Hi MME, I did solve this issue and make it run on my phone. |
@CHLLHC could you please share how you got it to work? |
I try numerous methods, I have listed all I remember above. But my confession is that I didn't undo all operations from one method before trying another. Although I got it work after adding the line The only thing I am sure is the first method in my original post (optimize_for_inference) is not helping. And I only get my app running on a phone with 4GB of ram. |
using the prebuilt binaries results in the exact error mentioned above ( However, I was able to get this working with only the following steps:
Although I'm rather new to bazel, I have the suspicion that I wasted many iterations by not running a |
@matt-deboer Thank you for your nice instructions ! Do you mind sharing the .jar you get following your bazel command? I built mine with following your comment but I get this exception when I run my app: Caused by: java.lang.RuntimeException: Native TF methods not found; check that the correct native libraries are present in the APK.
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.prepareNativeRuntime(TensorFlowInferenceInterface.java:534)
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.<init>(TensorFlowInferenceInterface.java:60) Also do you do anything special with .jar and .so created? I simply add them in my 'libs' and 'libs/armeabi-v7a/' respectively, and add the .jar as a dependency in my build.gradle. Should I do something else ? |
@GauthierChan It looks like your custom .so is not being packaged into the apk. Putting them in the
|
I had trouble with these instructions for quite a while, I was still getting the 'Native TF methods not found' errors. After a while, I realized that the problem was my Android CPU was not arm-based, but rather x86_64. So, in my case, I used the awesome instructions from @matt-deboer, but replaced 'cpu=armeabi-v7a' with 'cpu=x86_64', and that resolved things for me. |
Hi, I have read (#9763 =>) #9476 #5764 #8486 #6260 #5921 (#1269 This one is too old to be helpful).
I was trying to use YOLOv2 on Android TensorFlow. I followed the exact same procedure stated in the README that successfully got the tiny-yolo-voc model running on my phones, the only different in the code is the filename. But I got the following error message and the app die.
I also tried Yolo9000, it works (actually died because I didnot provide the matching label/name set, but it didnot yield the same error).
tensorflow/core/kernels/extract_image_patches_op.cc
totf_op_files.txt
(No OpKernel for DepthwiseConv2dNative #5764), and run bazel like this$ bazel build -c opt //tensorflow/examples/android:tensorflow_demo --copt="-DSELECTIVE_REGISTRATION" --define ANDROID_TYPES=__ANDROID_TYPES_FULL__
(iOS: No OpKernel was registered to support Op 'Less' with these attrs. #9476), still, didn't work for me.I am using ubuntu 16.04,
TensorFlow installed from (I think I did not install because I just
pip list
and tensorflow was not on that list. I just follow https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android , and every thing works for tiny-yolo-voc),[bazel release 0.4.5],
my phone is running Android 7.0
Thanks,
CHL
The text was updated successfully, but these errors were encountered: