Skip to content
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

put the PB and txt files in the assets folder. #9

Open
DRACOyu opened this issue Aug 14, 2018 · 3 comments
Open

put the PB and txt files in the assets folder. #9

DRACOyu opened this issue Aug 14, 2018 · 3 comments

Comments

@DRACOyu
Copy link

DRACOyu commented Aug 14, 2018

I follow the instructions to put the PB and txt files in the assets folder. After the app opens, it will flash back. I am training the yolo2 to do face detection. The output is 30=5*6. What is the reason?

@szaza
Copy link
Owner

szaza commented Aug 14, 2018

Could you please send me the exception what you get?
You trained the model for only one class, right?

@aaronhan92
Copy link

Hi Szaza,

Fyi, I am using yolov2-tiny.cfg and yolov2-tiny-voc_10000.weights to train my own dataset (winnie the pooh and tiger) . However, the Yolov2 app does not work after finished the training, I exported and replaced both yolov2-tiny.pb and label.txt file in android/asset/folder.

Please kindly advise.

Here's the error
09/29 10:30:03: Launching android-yolo-v2
$ adb install-multiple -r -t -p org.tensorflow.yolo C:\Users\hanwe\android-yolo-v2\gradleBuild\outputs\apk\debug\android-yolo-v2-debug.apk
Split APKs installed
$ adb shell am start -n "org.tensorflow.yolo/org.tensorflow.yolo.view.ClassifierActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Connected to process 13342 on device oppo-cph1719-97bc8b7
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/TensorFlowInferenceInterface: Model load took 2778ms, TensorFlow version: 1.6.0-rc1
I/TensorFlowInferenceInterface: Successfully loaded model from 'file:///android_asset/tiny-yolo-voc-graph.pb'
I/YOLO: Sensor orientation: 90, Screen orientation: 0
I/YOLO: Initializing at size 640x480
E/CheckPermission: camera-code= 11
E/CheckPermission: camera-code= 10
E/CheckPermission: camera-code= 2
E/CheckPermission: camera-code= 11
I/CameraManager: Using legacy camera HAL.
D/Camera: mHypnusCtrl is true
E/CheckPermission: camera-code= 5
E/CheckPermission: camera-code= 2
E/CheckPermission: real_camera-code= 12
E/CheckPermission: camera-code= 1
E/CheckPermission: camera-code= 1
E/CheckPermission: camera-code= 2
E/CheckPermission: real_camera-code= 11
I/YOLO: Opening camera preview: 640x480
I/CameraDeviceState: Legacy camera service transitioning to state CONFIGURING
I/RequestThread-0: Configure outputs: 2 surfaces configured.
D/Camera: app passed NULL surface
E/CheckPermission: real_camera-code= 2
E/CheckPermission: real_camera-code= 11
E/CheckPermission: real_camera-code= 10
E/ANR_LOG: >>> msg's executing time is too long
E/ANR_LOG: Blocked msg = { when=-4s790ms what=0 target=android.view.Choreographer$FrameHandler callback=android.view.Choreographer$FrameDisplayEventReceiver } , cost = 4707 ms
E/ANR_LOG: >>>Current msg List is:
E/ANR_LOG: Current msg <1> = { when=-4s797ms what=0 target=android.os.Handler callback=android.app.Activity$1 }
E/ANR_LOG: Current msg <2> = { when=-4s784ms what=5 target=android.view.ViewRootImpl$ViewRootHandler obj=com.android.internal.os.SomeArgs@9618dbb }
E/ANR_LOG: Current msg <3> = { when=-4s708ms what=13 target=android.view.ViewRootImpl$ViewRootHandler }
E/ANR_LOG: Current msg <4> = { when=-4s707ms what=4 target=android.view.inputmethod.InputMethodManager$H arg1=1 }
E/ANR_LOG: Current msg <5> = { when=-4s704ms what=2 target=android.view.inputmethod.InputMethodManager$H obj=InputBindResult{com.android.internal.view.IInputMethodSession$Stub$Proxy@15a82d8 com.emoji.keyboard.touchpal/com.cootek.smartinput5.TouchPalIME sequence:346 userActionNotificationSequenceNumber:2} }
E/ANR_LOG: Current msg <6> = { when=-4s701ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.app.ActivityThread$1 }
E/ANR_LOG: Current msg <7> = { when=-4s683ms what=100 target=com.android.internal.view.IInputConnectionWrapper$MyHandler }
E/ANR_LOG: Current msg <8> = { when=-4s683ms what=65 target=com.android.internal.view.IInputConnectionWrapper$MyHandler }
E/ANR_LOG: Current msg <9> = { when=-4s681ms barrier=2 }
E/ANR_LOG: Current msg <10> = { when=-4s439ms what=149 target=android.app.ActivityThread$H obj=android.os.BinderProxy@3d76f8e }
E/ANR_LOG: Current msg <11> = { when=+4s930ms what=132 target=android.app.ActivityThread$H }
E/ANR_LOG: >>>CURRENT MSG DUMP OVER<<<
I/Choreographer: Skipped 280 frames! The application may be doing too much work on its main thread.
I/CameraDeviceState: Legacy camera service transitioning to state IDLE
I/RequestQueue: Repeating capture request set.
W/LegacyRequestMapper: convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
W/LegacyRequestMapper: Only received metering rectangles with weight 0.
W/LegacyRequestMapper: Only received metering rectangles with weight 0.
E/CheckPermission: real_camera-code= 10
E/CheckPermission: real_camera-code= 2
E/CheckPermission: real_camera-code= 5
E/CheckPermission: real_camera-code= 8
E/CheckPermission: real_camera-code= 12
E/CheckPermission: real_camera-code= 11
I/CameraDeviceState: Legacy camera service transitioning to state CAPTURING
E/CheckPermission: real_camera-code= 12
E/CheckPermission: real_camera-code= 12
E/CheckPermission: real_camera-code= 12
E/CheckPermission: real_camera-code= 12
E/TensorFlowInferenceInterface: Failed to run TensorFlow inference with inputs:[input], outputs:[output]
E/AndroidRuntime: FATAL EXCEPTION: inference
Process: org.tensorflow.yolo, PID: 13342
java.lang.IllegalArgumentException: No OpKernel was registered to support Op 'ExtractImagePatches' with these attrs. Registered devices: [CPU], Registered kernels:

              	 [[Node: ExtractImagePatches = ExtractImagePatches[T=DT_FLOAT, ksizes=[1, 2, 2, 1], padding="VALID", rates=[1, 1, 1, 1], strides=[1, 2, 2, 1]](47-leaky)]]
                  at org.tensorflow.Session.run(Native Method)
                  at org.tensorflow.Session.access$100(Session.java:48)
                  at org.tensorflow.Session$Runner.runHelper(Session.java:298)
                  at org.tensorflow.Session$Runner.run(Session.java:248)
                  at org.tensorflow.contrib.android.TensorFlowInferenceInterface.run(TensorFlowInferenceInterface.java:230)
                  at org.tensorflow.contrib.android.TensorFlowInferenceInterface.run(TensorFlowInferenceInterface.java:197)
                  at org.tensorflow.contrib.android.TensorFlowInferenceInterface.run(TensorFlowInferenceInterface.java:187)
                  at org.tensorflow.yolo.TensorFlowImageRecognizer.runTensorFlow(TensorFlowImageRecognizer.java:67)
                  at org.tensorflow.yolo.TensorFlowImageRecognizer.recognizeImage(TensorFlowImageRecognizer.java:50)
                  at org.tensorflow.yolo.view.ClassifierActivity.lambda$onImageAvailable$1$ClassifierActivity(ClassifierActivity.java:107)
                  at org.tensorflow.yolo.view.ClassifierActivity$$Lambda$1.run(Unknown Source)
                  at android.os.Handler.handleCallback(Handler.java:751)
                  at android.os.Handler.dispatchMessage(Handler.java:95)
                  at android.os.Looper.loop(Looper.java:185)
                  at android.os.HandlerThread.run(HandlerThread.java:61)

@balaji199823
Copy link

hello szaza
i have changed the .pb as well as the label.txt file then the app is build but wen i open the app it stop directly i didnt get any error but the yolo_tiny-obj_last.weight file detect by objects and i converted as per ur instructions to .pb file then also it is not working in ur android gradle.
plz i want ur help plz reply me as soon as possible
my email id: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants