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

module-info.java for 'modelimport' contains invalid (old) exports #10049

Open
bo-ve opened this issue Nov 29, 2023 · 4 comments
Open

module-info.java for 'modelimport' contains invalid (old) exports #10049

bo-ve opened this issue Nov 29, 2023 · 4 comments

Comments

@bo-ve
Copy link

bo-ve commented Nov 29, 2023

Issue Description

Execution under JAVA9+ fails with the module loading error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users***.gradle\caches\modules-2\files-2.1\org.deeplearning4j\deeplearning4j-modelimport\1.0.0-M2.1\243b6fe760e61d75917392c4d61f318716504f1e\deeplearning4j-modelimport-1.0.0-M2.1.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Package org.deeplearning4j.frameworkimport.keras.keras.layers.convolutional not found in module

Version Information

Deeplearning4j 1.0.0-M2.1

Additional Information

The issue introduced in the Misc fixes for java side for M2 release commit due to package renames, like
org.deeplearning4j.frameworkimport.keras.keras.KerasModelImport =>org.deeplearning4j.nn.modelimport.keras.KerasModelImport

@agibsonccc
Copy link
Contributor

@bo-ve do you mind taking a crack at a pull request for this? Otherwise I can take a look at this before the next release. Thanks!

@gerrycoding
Copy link

I seem to have the same problem. I cannot require the packages in my module-info file. The module-info of deeplearning.modelimport has only exports of names that are not it, such as:
exports org.deeplearning4j.frameworkimport.keras.keras.layers;
What it should say is probably org.deeplearning4j.nn.modelimport.keras.layers
Unfortunately, thus the library cannot be used.

@agibsonccc
Copy link
Contributor

Great feedback! I'm unfortunately finalizing testing right now and will get to this before the release. It's taking longer than I'd like but all tests must pass on both cpu and cuda before I can finish this out. I'll do a lot more testing on java 17 to make sure everything is good. @gerrycoding could you give me more information about the environment?
Could also clarify about it not being usable at all? I'm at least able to run code in java 17 no problem.
It's been quite a while since M2.1 so maybe this isn't even an issue anymore.

@gerrycoding
Copy link

gerrycoding commented Dec 10, 2023

We are building a game in JavaFX. Neural networks are supposed to strengthen the ai-players. So the idea is to build the networks with python/keras and then import them into the java project. If I have a plain Java project, not using JavaFX and thus not having any module-info file, the imports are found in the external libraries which are included via maven. So I can compile the program and load the network and make an inference. But as soon as I include any module-info file, which I need to include the FX libraries, many packages I need, are not found if I use the proper names of the the packages in my "require" declarations, since the module-info of those modules do not export them. As I quoted above, in the 'modelimport' module the names of the exports don't fit the names of the real packages. Intellij asks me to modify the module-info and add the correct exports. But of course, I cannot write to them.
Im using Java 17, and the M2.1 Version. I tried to change the maven dependencies to an older version, but maven then says it cannot find them.

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