-
Notifications
You must be signed in to change notification settings - Fork 86
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
Unable to load the pb file from Custom training model #30
Comments
did you actually uploaded .pb file into your asset folder? |
Hi ZZANZU, |
Hi @Kabster17, As an alternative solution you can try to downgrade the TF version used for training to 1.6.0, or just to use the same version for training and on the mobile app. Best regards, |
Hi Zoltan, Thanks a lot for your reply man. Really appreciate it. Yeah i found out that i needed to downgrade to tf to 1.6.0 for the training and did some training with some dummy data for about 50 epochs after which I did manage to install/run the app without it crashing and no errors. However, it is unable to detect anything yet hopefully more training and lower loss rate would solve that.
|
Hi @Kabster17,
|
Hi Zoltan @szaza , Thank you for your reply. Yes, i am looking into ways to enhance your application to perform image capturing and video recording with the detection bounding boxes being present. I think it would make the app more complete. |
Hi, |
Hi @szaza , Yeah sure. Thanks for your help. Is there something wrong with my edit or method of training? I am using the same images i used to train to test the app's detection with. |
Hi, |
Hi @szaza, I have tested my generated pb file on desktop side, and it gives me no detection as well. It does not recognize the images. Like i have mentioned before, I have trained using Tiny-Yolo using tensorflow 1.14.0 version. It is a set of custom data but i dont understand using the pb files and meta files to perform detection is not occuring. Have you experienced this? I trained for 5 classes using about 100 images per class to train for about 25000 steps but after generating the pb files using this command: Using the pb files, i am not able to get any detection but loading the images thru the checkpoint model, I am able to achieve good detection. |
Hi, |
Hi @szaza, I just started to read up on the darkflow bug with regards to the generation of the .pb files. Let me just check with you the following:
|
Hi Kabster17, "I trained my custom model with yolov2 weights instead of tiny-yolo-voc weights, is there a difference between them? I mean I am able to detect using the normal python flow method as mentioned earlier." - yes, that can be a problem. YoloV2 is a larger model than tiny-yolo, so easily can happen that you don't have enough memory in your mobile phone to execute it. Is your installation able to work with the sample weights, that can be found here: https://github.com/szaza/android-yolo-v2/tree/master/assets? |
Hi @szaza, Yes i could detect and work with your sample .pb and labels.txt files. |
Can you suggest to me what can i do to improve the detection results with regards to the training and what not. As I would like to get some sort of decent detection results to look further into improving the model or evaluating the model. Thanks. |
Sorry for the late reply, I was very busy. |
Hi Szaza,
Thanks a lot for your contribution. I am using Windows 10 and I have incorporated training of my custom model using tiny-yolo to identify 2 classes.
Now, I would like to load it into an android app however I am unable to use the app on my phone, it keeps crashing.
Is it because I did my training of my custom model using tensorflow 1.14.0?
As i am new to this area of Android Studio and applications. I would really appreciate some guidance. Thanks.
Here is the error that i am receiving when i start the app on my mobile device.
2019-12-29 18:41:56.072 28172-28172/org.tensorflow.yolo E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.tensorflow.yolo, PID: 28172
java.lang.RuntimeException: Failed to load model from 'file:///android_asset/tiny-yolo-voc-graph.pb'
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.(TensorFlowInferenceInterface.java:113)
at org.tensorflow.yolo.TensorFlowImageRecognizer.create(TensorFlowImageRecognizer.java:42)
at org.tensorflow.yolo.view.ClassifierActivity.onPreviewSizeChosen(ClassifierActivity.java:55)
at org.tensorflow.yolo.view.CameraActivity.lambda$setFragment$0$CameraActivity(CameraActivity.java:116)
at org.tensorflow.yolo.view.-$$Lambda$CameraActivity$SAOsaS8oaXCIIH441aIwhMnb5HU.onPreviewSizeChosen(Unknown Source:2)
at org.tensorflow.yolo.view.CameraConnectionFragment.setUpCameraOutputs(CameraConnectionFragment.java:291)
at org.tensorflow.yolo.view.CameraConnectionFragment.openCamera(CameraConnectionFragment.java:298)
at org.tensorflow.yolo.view.CameraConnectionFragment.access$000(CameraConnectionFragment.java:52)
at org.tensorflow.yolo.view.CameraConnectionFragment$1.onSurfaceTextureAvailable(CameraConnectionFragment.java:163)
at android.view.TextureView.getTextureLayer(TextureView.java:390)
at android.view.TextureView.draw(TextureView.java:339)
at android.view.View.updateDisplayListIfDirty(View.java:20761)
at android.view.View.draw(View.java:21614)
at android.view.ViewGroup.drawChild(ViewGroup.java:4558)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4333)
at android.view.View.updateDisplayListIfDirty(View.java:20747)
at android.view.View.draw(View.java:21614)
at android.view.ViewGroup.drawChild(ViewGroup.java:4558)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4333)
at android.view.View.draw(View.java:21891)
at android.view.View.updateDisplayListIfDirty(View.java:20761)
at android.view.View.draw(View.java:21614)
at android.view.ViewGroup.drawChild(ViewGroup.java:4558)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4333)
at android.view.View.updateDisplayListIfDirty(View.java:20747)
at android.view.View.draw(View.java:21614)
at android.view.ViewGroup.drawChild(ViewGroup.java:4558)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4333)
at android.view.View.updateDisplayListIfDirty(View.java:20747)
at android.view.View.draw(View.java:21614)
at android.view.ViewGroup.drawChild(ViewGroup.java:4558)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4333)
at android.view.View.draw(View.java:21891)
at com.android.internal.policy.DecorView.draw(DecorView.java:1082)
at android.view.View.updateDisplayListIfDirty(View.java:20761)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3935)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3709)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3017)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1876)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8499)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7037)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
2019-12-29 18:41:56.072 28172-28172/org.tensorflow.yolo E/AndroidRuntime: Caused by: java.io.IOException: Not a valid TensorFlow Graph serialization: NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: {{node 0-convolutional}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.loadGraph(TensorFlowInferenceInterface.java:561)
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.(TensorFlowInferenceInterface.java:105)
... 53 more
The text was updated successfully, but these errors were encountered: