tensorflow: Android build failed using custom tensorflow model. Conflict workspace Error
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes, I have modified no. of classes to be detect while training the model
- **OS Platform and Distribution: 14.04 LTS
- Mobile device if the issue happens on mobile device: Motoroloa, Android version 7.1.1
- TensorFlow installed from (source or binary): Source
- TensorFlow version (use command below): 1.10.0
- Python version: 3.6
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source): 7.2.0
- CUDA/cuDNN version: NA
- GPU model and memory: 4GB RAM, 64-bit
Describe the problem
I had trained my custom model with different objects for the detection purpose. I had used ssd_mobilenet_v2_coco for my training. I could pull out the object detection on desktop with the customised trained model by using the webcam or passing an image. But I am unable to port it on android app.
It is interesting that I am able to convert the file in .tflite format (the one which will be used by bazel) and for android. However, after the app installation it is getting crashed. The app is forcibly closed. It may be noted here that the classifier and speech app is working fine and there is no force shut down, but the problem remained the same with detect app. I then followed this link for change in the DetectorActivity.java inside tensorflow/contrib/lite/examples/android/app/src/main/java/org/tensorflow/demo/DetectorActivity.java as below private static final int TF_OD_API_INPUT_SIZE = 300; private static final boolean TF_OD_API_IS_QUANTIZED = true; private static final String TF_OD_API_MODEL_FILE = "detect.tflite"; //private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/coco_labels_list.txt"; private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/labelmap.txt";
where detect.tflite and labelmap.txt both files are from the customized model.
Then I ran the command
bazel build -c opt --cxxopt='--std=c++11' "//tensorflow/contrib/lite/examples/android:tflite_demo" and this successfully build the apk file and other dependencies. Meanwhile, it showed a conflict error. Errors read as below:
`CONFLICT: asset:WORKSPACE is provided with ambiguous priority from:
external/tflite_mobilenet/WORKSPACE
external/tflite_conv_actions_frozen/WORKSPACE
CONFLICT: asset:WORKSPACE is provided with ambiguous priority from: external/tflite_mobilenet_ssd/WORKSPACE external/tflite_conv_actions_frozen/WORKSPACE`
When I tried to build the apk over phone, the app is installed but it is getting closed forcefully. However, the classifier and speech apps are working perfectly fine.
NOTE: The pre trained models are working absolutely fine on both desktop and as an app. However, the issue is with importing the custom app on phone.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (8 by maintainers)
@inakaaay this error occur because of mismatch in the input shape given to the model.