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

Trying to build version 1.0.0-rc.1 module org.tensorflow can no longer be found. #553

Closed
odinsbane opened this issue Aug 5, 2024 · 7 comments

Comments

@odinsbane
Copy link

odinsbane commented Aug 5, 2024

System information

  • Windows WSL2 Linux, Ubuntu
  • Tensorflow from maven artifacts:
  • TensorFlow version:
  • Java version 21
  • Installed from Maven Central? Yes and OSS sonatype

When I tried to upgrade to 1.0.0.rc-1 I get src/main/java/module-info.java:[4,17] module not found: org.tensorflow

Provide the exact sequence of commands / steps that you executed before running into the problem

I have a working pom.xml with the dependency.

    <dependency>
      <groupId>org.tensorflow</groupId>
      <artifactId>tensorflow-core-platform-gpu</artifactId>
      <version>0.5.0</version>
    </dependency>

I wanted to switch to the 1.0.0 release candidate by following the github page.

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

Then my module-info.java causes an error and the project doesn't compile.

src/main/java/module-info.java:[4,17] module not found: org.tensorflow

I could setup a complete source code + pom.xml to reproduce the problem. Maybe this problem is simpler than that though, and I am using the wrong dependencies.

@karllessard
Copy link
Collaborator

karllessard commented Aug 5, 2024

Hi @odinsbane , starting from tensorflow java 1.0.0-rc1, the module has been renamed to simply tensorflow

@karllessard
Copy link
Collaborator

Which makes me realize that this indication is missing in our migration instructions, I’ll make sure to add this as well, thank you

@odinsbane
Copy link
Author

That did it, I changed the requires then everything built and even ran successfully.

@odinsbane
Copy link
Author

@karllessard Something else that might be good to explain. Instead of using the artifact-id to denote the GPU version. Now it uses the "tensorflow-core-natives" with <classifier>linux-x86_64-gpu</classifier> to get the gpu natives. I didn't find the distinction until I went through the maven repos a bit.

@karllessard
Copy link
Collaborator

@odinsbane that part is mentioned in the migrating guide though, please look at this section: https://github.com/tensorflow/java/blob/master/MIGRATING.md#native-artifact-renaming

@odinsbane
Copy link
Author

@karllessard I was specifically referring to the tensorflow-core-platform-gpu artifact which no longer exists. The 0.5.0 example seems a little strange because it has the same artifactId twice, but one has an identifier.

<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow-core-api</artifactId>
    <version>0.5.0</version>
</dependency>
<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow-core-api</artifactId>
    <version>0.5.0</version>
    <classifier>linux-x86_64</classifier>
</dependency>

The way I did it used the <artifactId>tensorflow-core-platform-gpu</artifactId>. Maybe it is clear, and I don't understand how the maven classifiers work well enough.

@Craigacp
Copy link
Collaborator

Craigacp commented Aug 6, 2024

The platform artifact pulls in a set of native libraries (currently Windows x86_64, Linux x86_64, macOS x86_64 and macOS arm64), and the platform gpu artifact used to pull in both Linux & Windows GPU binaries until Google stopped supporting Windows GPU binaries. When that happened we stopped making a platform-gpu artifact because it was identical to depending on org.tensorflow:tensorflow-core-native:1.0.0-rc.1:linux-x86_64-gpu.

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

3 participants