i tried installing with gradle, but that failed as it did not like the dependency line: implementation âorg.tensorflowâ, name: âtensorflow-core-platformâ, version: â0.3.3â it complains about the format.
so i am using elipse with maven. i donât know anythin abot maven. switching to 1.8 helped a lot. but i still get some erroes (please see below).
can i just donwload some jars from somewhere? can they be fished out of maven somehow?
For gradle to include the platform dependency you might need to use something like implementation "org.tensorflow:tensorflow-core-platform:0.4.2@pom" as the platform dependency is just a pom file that pulls in other dependencies.
The jars can be downloaded from Maven Central by searching at https://search.maven.org and pulling down the appropriate files (e.g. Central Repository: org/tensorflow/tensorflow-core/0.4.2), but itâs preferable to get Maven or Gradle running properly as itâll handle the platform specific native dependencies better.
You still need to add tensorflow-core-api and tensorflow-framework as dependencies in addition to platform. The platform dependency pulls in the native parts, the other two I mentioned are the Java apis.
Add cannot be resolved to a type
ConcreteFunction cannot be resolved
ConcreteFunction cannot be resolved to a type
Ops cannot be resolved to a type
Placeholder cannot be resolved to a type
Signature cannot be resolved
Signature cannot be resolved to a type
Tensor cannot be resolved to a type
TensorFlow cannot be resolved
The import org.tensorflow.op.core.Placeholder cannot be resolved
The import org.tensorflow.op.math.Add cannot be resolved
The import org.tensorflow.op.Ops cannot be resolved
The import org.tensorflow.types.TInt32 cannot be resolved
The import org.tensorflow cannot be resolved
TInt32 cannot be resolved
TInt32 cannot be resolved to a type
TInt32 cannot be resolved to a type
TInt32 cannot be resolved to a type
TInt32 cannot be resolved to a type
TInt32 cannot be resolved to a type
TInt32 cannot be resolved to a type
Those live in tensorflow-core-api. You should not mix the old libtensorflow v1.x jars with the newer tensorflow-core v0.x jars, thatâll cause weird errors.
TInt32 is indeed in tensorflow-core-api-0.4.2.jar. so i am wondering why eclipse is complaining.
How am i mixing the old lib stuff? is that in the 0.3.3 jars? or is that the TInt32 stuff?
the simple program below fails wiith a no class fould.
thanks
D:\tensorflow\2>java -cp src p.Foo
Exception in thread âmainâ java.lang.NoClassDefFoundError: org/te
nsorflow/TensorFlow
at p.Foo.main(Foo.java:5)
Caused by: java.lang.ClassNotFoundException: org.tensorflow.Tenso
rFlow
at java.base/jdk.internal.loader.BuiltinClassLoader.loadC
lass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoa
der.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.
java:521)
⌠1 more
package p;
import org.tensorflow.TensorFlow;
public class Foo {
public static void main(String[] args) {
System.out.println("Hello TensorFlow "+TensorFlow.version());
}
}
Your previous post mentioned downloading libtensorflow-1.14.0, I was saying that you shouldnât use that. If you only have tensorflow-core-api 0.4.2, tensorflow-core-platform 0.4.2 and ndarray 0.3.3 you should be ok.
I donât know why java isnât loading those jars when executing the single source file, nor why Eclipse is misconfigured.
i am not usingg any dll. i am getting a clean compile with eclipse when using jre 1.8. tring to print the version gets a can not find com.google.protobuf.InvalidProtocolBufferException, while try(ConcreteFunction dbl=ConcreteFunction.create(HelloTensorFlow::dbl); gets a can not find org/bytedeco/javacpp/Pointer.