tensorflow / java

Java bindings for TensorFlow
Apache License 2.0
785 stars 193 forks source link

right dependency for org.tensorflow.proto.framework? #537

Closed ngbusca closed 2 months ago

ngbusca commented 2 months ago

System information

Describe the problem

In the previous version of TF 0.5.0 I was able to configure GPU properties via ConfigProto:

       ConfigProto configproto = ConfigProto
                .newBuilder()
                .setAllowSoftPlacement(false)
                .setGpuOptions(GPUOptions.newBuilder()
                        .setForceGpuCompatible(true)
                        .setPerProcessGpuMemoryFraction(0.9)
                        .setAllowGrowth(true).build())
                .build();

In 1.0.0 maven doesn't find:

import org.tensorflow.proto.framework.ConfigProto;
import org.tensorflow.proto.framework.GPUOptions;
import org.tensorflow.proto.framework.GraphDef;

What are the right dependencies to include for 1.0.0 ? I have the following dependencies:

  <dependency>
      <groupId> org.tensorflow </groupId>
      <artifactId> tensorflow-core-native </artifactId>
      <version> 1.0.0-rc.1 </version>
      <classifier>linux-x86_64-gpu</classifier>
  </dependency>

  <dependency>
      <groupId> org.tensorflow </groupId>
      <artifactId> tensorflow-core-api </artifactId>
      <version> 1.0.0-rc.1 </version>
  </dependency>

Thanks in advance

Craigacp commented 2 months ago

It's in tensorflow-core-native - https://github.com/tensorflow/java/blob/r1.0/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProto.java.

A bunch of protos moved as part of the build changes.

ngbusca commented 2 months ago

But I have tensorflow-core-native in my pom...

ngbusca commented 2 months ago

Sorry, now I understand your comment :-)

I replaced the import to:

import org.tensorflow.proto.ConfigProto;
import org.tensorflow.proto.GPUOptions;
import org.tensorflow.proto.GraphDef;

now it works!