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

using a different pb file #6

Closed
ramarajan09 opened this issue Mar 31, 2017 · 4 comments
Closed

using a different pb file #6

ramarajan09 opened this issue Mar 31, 2017 · 4 comments

Comments

@ramarajan09
Copy link

Hi,

I believe the pb file you derived is for yolo-voc, however, I would like to have a pb file for YOLOv2 608x608 ( https://pjreddie.com/darknet/yolo/).

Use darkflow (https://github.com/thtrieu/darkflow) I was able to create a pb file using yolo.cfg and yolo.weights.

I copied the yolo.pb file into the assets folder and when I try to install the apk, I get the following error:

03-31 16:08:26.398 19432-19652/org.tensorflow.tensorflowdemo I/tensorflow: CameraConnectionFragment: Opening camera preview: 480x640
03-31 16:08:26.402 19432-19432/org.tensorflow.tensorflowdemo V/BoundingBox: width: 1080.0 height: 1794.0
03-31 16:08:26.415 19432-19652/org.tensorflow.tensorflowdemo I/tensorflow: CameraConnectionFragment: Getting assets.
03-31 16:08:26.415 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:115 Loading TensorFlow.
03-31 16:08:26.415 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:117 Making new SessionOptions.
03-31 16:08:26.415 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:120 Got config, 0 devices
03-31 16:08:26.417 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:123 Session created.
03-31 16:08:26.417 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:126 Graph created.
03-31 16:08:26.417 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:130 Acquired AssetManager.
03-31 16:08:26.417 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:132 Reading file to proto: file:///android_asset/yolo.pb
03-31 16:08:26.797 19432-19652/org.tensorflow.tensorflowdemo I/native: stat_summarizer.cc:33 StatSummarizer found 349 nodes
03-31 16:08:26.798 19432-19652/org.tensorflow.tensorflowdemo I/native: tensorflow_jni.cc:137 Creating session.
03-31 16:08:26.827 19432-19652/org.tensorflow.tensorflowdemo A/native: tensorflow_jni.cc:140 Could not create TensorFlow Graph: Not found: Op type not registered 'RealDiv'
03-31 16:08:26.834 19432-19652/org.tensorflow.tensorflowdemo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 19652 (ImageListener)
03-31 16:08:26.834 368: 368 W/ ]
debuggerd: handling request: pid=19432 uid=10094 gid=10094 tid=19652

@natanielruiz
Copy link
Owner

Hello,
The yolo v2 model has a different output layer (and input) than the yolo v1 voc that I am using. This means that just replacing the .pb file will not work. Also your error tells me that some of the operations in your pb file are not supported by tensorflow mobile.

I will be updating the code these next two months to use yolo v2. You can also try to do it on your own by:
-adapting the input size
-adapting the output c++ cod
-adapting the java code that makes sense of the output of the model
-figuring out a way to make the ops work with tensorflow mobile

Good luck!

@zhangwenwen
Copy link

Now yolo v2 model is supported ?

@anoobbacker
Copy link

@natanielruiz Is yolo v2 support ready?

@ghost
Copy link

ghost commented Mar 15, 2018

I'm trying to do the same. Did you manage to get this to work? / How far did you get? When I replaced the .pb file with one I created using https://github.com/thtrieu/darkflow, the app immediately crashed, even using yolov1 weights. Both when using yolov1 weights and v2 weights to generate the .pb file, I received the error:
A/native: tensorflow_jni.cc:140 Could not create TensorFlow Graph: Not found: Op type not registered 'RealDiv'
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 14281 (ImageListener), pid 14254 (.tensorflowdemo)

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