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

Downloading TensorFlow library #2

Open
Rudloff opened this issue May 16, 2018 · 1 comment
Open

Downloading TensorFlow library #2

Rudloff opened this issue May 16, 2018 · 1 comment

Comments

@Rudloff
Copy link

Rudloff commented May 16, 2018

Hello,

Sorry to bother you again but I'm getting this error when running gradlew assemble:

:compileDebugJavaWithJavac
/home/pierre/www/youtube-reader/src/main/java/com/vackosar/youtubereader/GraphExecutor.java:5: error: package org.tensorflow.contrib.android does not exist
import org.tensorflow.contrib.android.TensorFlowInferenceInterface;
                                     ^
/home/pierre/www/youtube-reader/src/main/java/com/vackosar/youtubereader/GraphExecutor.java:20: error: cannot find symbol
    private final TensorFlowInferenceInterface inferenceInterface;
                  ^
  symbol:   class TensorFlowInferenceInterface
  location: class GraphExecutor
/home/pierre/www/youtube-reader/src/main/java/com/vackosar/youtubereader/GraphExecutor.java:27: error: cannot find symbol
        this.inferenceInterface = new TensorFlowInferenceInterface(assetManager, MODEL_FILENAME);
                                      ^
  symbol:   class TensorFlowInferenceInterface
  location: class GraphExecutor
3 errors
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I see you are getting this library locally:

def tensorflowRepo = '/data/androidStudioProjects/tensorflow/'

But wouldn't it be possible to add something like this to build.gradle:

diff --git a/build.gradle b/build.gradle
index 48ee6bc..6ce75a3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -96,6 +96,7 @@ dependencies {
     compile 'commons-lang:commons-lang:2.3'
     testCompile 'junit:junit:4.12'
     testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
+    compile 'org.tensorflow:tensorflow-android:1.8.0'
 }
 
 task buildNativeBazel() {

so the library can be downloaded by Gradle.

@vackosar
Copy link
Owner

It is then configured locally like this:

java { srcDir tensorflowRepo + 'tensorflow/java/src/main/java' exclude '**/examples/**' }
If you do that you can then recompile even all the binaries. But I think your suggestion would probably work.

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

2 participants