Comments (8)
Thank you, it ran finally.
org.tensorflow:tensorflow-lite-support:0.1.0
LCE package:0.6.2
Gradle:4.2.0
from compute-engine.
You'll have to make both changes, not one of the two:
I could resolve this issue by using an older version of the LCE package (0.6.2 instead of 0.7.0) and by changing org.tensorflow:tensorflow-lite-support:0.3.0 back to org.tensorflow:tensorflow-lite-support:0.1.0.
Or at least, that's what I did to make it work.
from compute-engine.
I could not reproduce this issue. I took a fresh clone of the TensorFlow examples repository, then followed the steps up to the point where this exclude is added. Then I tried to build the project and I don't see any issues when I run Make Project
. My git diff
at this point looks like this:
diff --git a/lite/examples/image_classification/android/build.gradle b/lite/examples/image_classification/android/build.gradle
index c0602307..5ca4a13c 100644
--- a/lite/examples/image_classification/android/build.gradle
+++ b/lite/examples/image_classification/android/build.gradle
@@ -18,6 +18,7 @@ allprojects {
repositories {
google()
mavenCentral()
+ mavenLocal()
maven {
name 'ossrh-snapshot'
url 'https://oss.sonatype.org/content/repositories/snapshots'
diff --git a/lite/examples/image_classification/android/lib_support/build.gradle b/lite/examples/image_classification/android/lib_support/build.gradle
index 87cb34ad..3d27b5d0 100644
--- a/lite/examples/image_classification/android/lib_support/build.gradle
+++ b/lite/examples/image_classification/android/lib_support/build.gradle
@@ -38,11 +38,14 @@ dependencies {
implementation project(":models")
implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'org.larq:lce-lite:0.1.000'
// Build off of nightly TensorFlow Lite
- implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly-SNAPSHOT'
+ // implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly-SNAPSHOT'
implementation 'org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly-SNAPSHOT'
- implementation 'org.tensorflow:tensorflow-lite-support:0.3.0'
+ implementation ('org.tensorflow:tensorflow-lite-support:0.3.0') {
+ exclude module: 'tensorflow-lite'
+ }
// Use local TensorFlow library
// implementation 'org.tensorflow:tensorflow-lite-local:0.0.0'
When exactly do you see this message, during the project build or at runtime?
from compute-engine.
Thank you for replay.
I founded that I used org.tensorflow:tensorflow-lite-support:0.1.0
and there isn't org.tensorflow.lite.DataType
in version: 0.1.0, hence I changed it to org.tensorflow:tensorflow-lite-support:0.3.0
and I run Make Project
without error. When I run it on device, it closed rapidly.
May you run it?
from compute-engine.
Indeed, for me it also crashes. Did you do all the next steps in the tutorial as well (specifying the model, adding it to the assets folder, etc.)? And what error did you get (you can see it in the logcat
tab)? For me it errors with:
java.lang.NoSuchMethodError: No virtual method getNumThreads()I in class Lorg/tensorflow/lite/InterpreterImpl$Options; or its super classes (declaration of 'org.tensorflow.lite.InterpreterImpl$Options' appears in /data/app/~~3FKaP-HEhZueK6nrT2DUBQ==/org.tensorflow.lite.examples.classification-09a2my7j7KeKrfH4KmjP9Q==/base.apk)
I could resolve this issue by using an older version of the LCE package (0.6.2 instead of 0.7.0) and by changing org.tensorflow:tensorflow-lite-support:0.3.0
back to org.tensorflow:tensorflow-lite-support:0.1.0
.
This is an acceptable work-around I think, but we need to fix this properly for the long-term. I guess the LCE .aar release script needs some modifications to be compatible with the 0.3.0 version of tensorflow-lite-support
. I'll update here when that is solved, however that will not be on our high-priority list.
from compute-engine.
Unfortunately, I have same error. But your solution doesn't work for me, because I mentioned before, when I use org.tensorflow:tensorflow-lite-support:0.1.0
in classifier.java (under lib_support ) doesn't import 'org.tensorflow.lite.DataType'.
from compute-engine.
If you still get that some error, you most likely didn't downgrade the LCE package properly. As I said above, you'll need an older version of the LCE package (0.6.2 instead of 0.7.0). Then re-run the mvn install
command (I gave it a new version number and also updated that in the gradle file, but not sure if that's needed).
from compute-engine.
Thank you again for your reply.
I used org.tensorflow:tensorflow-lite-support:0.3.0
and LCE package 0.6.2. But, there are many duplication classes when I run Make Project
.
Duplicate class org.tensorflow.lite.DataType found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.DataType$1 found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.Delegate found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.Tensor found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.Tensor$QuantizationParams found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.annotations.UsedByReflection found in modules jetified-lce-lite-v0.6.2-runtime (lce-lite-v0.6.2.aar) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
from compute-engine.
Related Issues (20)
- Automatic release builds for benchmarking binaries are broken HOT 2
- Deployment on Cortex-M HOT 2
- Tensor transform triggers dequantization HOT 6
- Error on import HOT 2
- Select indirect BGEMM kernels - Benchmarking grouped binary convolutions HOT 3
- LCEInterpreter and converter design HOT 1
- core dumped when number of threads is larger than 2 HOT 3
- Benchmarking custom model HOT 3
- Int8 quantization for microcontroller HOT 13
- `convert_keras_model()` does not work as expected for BinaryDenseNet37 Dilated and XNORNet HOT 1
- DoReFa quantizer with higher number of MACs/Ops, Grouped convs as custom ops on LCE 0.7.0 HOT 3
- Get Operator-wise Profiling Results HOT 1
- Error while performing benchmarking HOT 44
- Bool input tensor HOT 7
- extra model size induced by non-parameter layer HOT 1
- Fix Android benchmarker build
- Larq Compute Engine seems incompatible with tensorflow-lite-task-vision on Android (using the latest tensorflow lite demo code) HOT 2
- Dorefa model size and behavior with full precision model and ste_sign model HOT 13
- Cannot save compressed binary or ternary weights, saved as float32 parameters HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compute-engine.