How to solve Deeplearning4j and Tensorflow error? - deeplearning4j

I am getting the error:
Failed to define class org.tensorflow.framework.DataType
I looked through the latest jars for Deeplearning4j and can not find it. Do I need to download from Maven the Tensorflow jars? I am running the new Deeplearning4j framework inside a j2ee Wildfly server for a web service using java 1.8.
Thanks!

Ok, I figured out where it is located. I downloaded the nd4j-tensor-1.0.0-beta4 jar and error went away.
-Tony

Deeplearning4j maintainer here. Cobbling together dependencies is always a bad idea:
Few things:
beta4 is decently old at this point and I would not recommend using it.
I'm guessing you're likely mixing versions. If you are, please don't. Always use the same version. The whole dl4j stack will always have the same versions and if different versions work together it's because you're lucky. It's not deliberate.
Generally try to use maven/gradle where possible for resolving dependencies. There's lots of small jars that can be mixed/matched.

Related

Junit5 with ant

I am new in ant and junit5. I went through several examples ant/junit4. But I did not find a normal example with a pair of ant with junit5. With a pair of ant with junit4 everything works fine. I downloaded the files from the official site of the junit5 https://junit.org/junit5/docs/current/user-guide/ (For Ant, check out the junit5-jupiter-starter-ant project.), but even they give an error at the very beginning(screen attached) I will try to fix them one by one, but I don't think that official repo committed with errors. Maybe I'm doing something wrong. Or maybe gurus suggest some other simple sample with ant/junit5.
Thank you in advance.
I try to run the original sources from https://github.com/junit-team/junit5-samples and expected to at least compile them. But I get plenty of errors.
So this post has 2 questions:
errors on the screenshot
ant+juni5 integration in general
To reproduce the exact issues one should have the same environment, which is at least the OS, Java version & Ant version. The example itself seems to be using the Junit5 ConsoleLauncher, which is one of the way to run the tests. Looking at the errors it looks like the issue is in the project itself, because if it cannot find the 'symbol' #Test then the Junit(5?) is simply not present on the classpath. Maybe this can be a hint to the author to trty to dig a bit more into the issue, particularly looking into the dependencies (jars) included.
Now going back to how to run Junit5 test with Ant, I can recall the "JUnitLauncher" that apache suggests: https://ant.apache.org/manual/Tasks/junitlauncher.html . Note that you should be attentive on the dependencies here as well, there are number of Jars to be included (opentest4j, junit-platform-xyz). Note that this also depends on the installation of Ant in the environment, so for example if you get a NoClassDefFound for JUnitLauncher, this can be solved by using the 'up-to-date' version of Ant: https://ant.apache.org/bindownload.cgi . In case of Linux you can place these Jars in home/your_username/.ant/lib directory, where it will be automatically picked up.

java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path

I started using the 1.0.0-beta2 version of deeplearning4j and I am getting the following error when attempting to start:
java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path
In looking around, I came across this issue: https://github.com/deeplearning4j/nd4j/issues/1687
where the solution seemed to be an incomplete set of packages. I have confirmed that I have nd4j-native-platform-1.0.0-beta2.jar, but this jar file contains no libraries as what seemed to be the problem in the issue mentioned above.
I have looked at the maven repository and things are strange there as well:
For https://mvnrepository.com/artifact/org.nd4j/nd4j-native-platform, the list of files under "View All" seems incomplete for the 1.0.0-beta2 version and the existing jar files under older versons also don't seem to contain any binaries so I am unsure as to where the binaries are supposed to be.
Thanks,
Jason
Do you have a specific OS you are trying? It should work out of the box if you just use platform. Platform includes numerous dependencies. I'm not sure what "incomplete" might be, but if you browse the real maven central (not this website, please do not use it):
https://repo1.maven.org/maven2/org/nd4j/nd4j-native/1.0.0-beta2/
You'll see jars for everything here. We have pretty good coverage publishing for every OS all the way to android and IOS.

Purescript - Unable to build with drawing and signals libraries

I'm trying to start a purescript project that uses the purescript signal and drawing libraries. When I try to bower install with both of them as dependencies, bower's interactive prompt asks to resolve several dependency versions. I admittedly pick the versions somewhat arbitrarily since most of the issues are several layers of dependencies deep. Then when I pulp build a basic hello world piece of code that doesn't even use the dependencies, pulp gives around 40 errors depending on which versions I selected.
How do I resolve these dependency versions correctly? Sifting through forty errors and all of the dependencies for both projects doesn't seem feasible. Is there some non-arbitrary way of picking the versions that will resolve the conflicts? From the choices it gave me, it didn't seem like there was any clear resolution. Or are their dependencies too conflicting and you just can't use them together?
This may actually be more of an question about bower, but it may also be something about purescript and pulp that I am just unaware of. They both seem like libraries that should be able to work together, and I can't imagine that other people are having too much difficulty using two or more libraries in a single project.
Purescript 0.10 has breaking changes. If you have the latest compiler, it's likely that it's not compatible with some libraries. From what I see, signal lib is updated but the drawing is not. You can update the lib and use your own version. Or, send a PR, Phil and purescript community in general, is really fast on responding to pull requests.
Another temporary solution is to use the old compiler (0.9) and wait a couple months till everything is back to normal.
also see 0.10 migration guide.

OpenCV 3.1.0 - LNK1104 with opencv_world310d.lib (Visual Studio Express 2013)

iam actually trying to get opencv running on my Computer. I allready configured the environment variables on Windows and added the Path for the includes and the libraries in a propertiesheet.
Now when i want to add additional dependencies i watched into my directory (opencv\build\x64\vs12\lib)and there are only two files. opencv_world310.lib and opencv_world310d.lib. So they are on my HDD.
I think these are the files i have to add?
I did this and then i got the error LNK1104 could not open "opencv_world310d.lib. Same with opencv_world310.lib.
Iam trying to build a example-code from opencv so there should be everything fine with it. I saw some Tutorials they did not have any issue. But they used OpenCv3.0
Is there any workaround?
kind regards
Yes. By default, opencv_world310.lib is the only file you should link with.
Or if you're building with Debug configuration, you should use opencv_world310d.lib instead.
Since the error code is LNK1104, I believe your additional library path is something wrong.
And then please check you are building x64 code not win32 code.

What are the very specific advantages to WebJars compared to simply using Bower?

I am new to WebJars and so far have failed to see any real advantages that they bring to the table compared to simply using Bower for example. What justifies the idea of putting frontend JS into backend JARs?
Please name at least one or more "objective" advantages to using WebJars.
WebJars are useful when you have a JVM-based project and you want to use only one dependency manager / build tool.

Resources