简体   繁体   English

获取 Deeplearning4j 异常

[英]Getting Deeplearning4j exception

I am getting the following exception at runtime using the latest Deeplearning4j release.我使用最新的 Deeplearning4j 版本在运行时收到以下异常。 The exception cause is listed below.下面列出了异常原因。 I do not get the full trace so not sure which class it is not finding.我没有得到完整的跟踪,所以不确定它没有找到哪个类。 I am not sure where the log can be found for that exception in hopes of seeing the full trace.我不确定在哪里可以找到该异常的日志,希望能看到完整的跟踪记录。 It is not in my app server log.它不在我的应用服务器日志中。 I am running using Java 1.8 using the Wildfly app server on Windows 10 prof.我在 Windows 10 教授上使用 Wildfly 应用服务器运行 Java 1.8。

Thanks for any help.谢谢你的帮助。 -Tony -托尼

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.nd4j.linalg.factory.Nd4j at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetworkHelper(ModelSerializer.java:283) at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:238) at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:222) at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:380) at com.myuniportal.service.MyUniPortalMapMobileAIResource.(Unknown Source) at com.myuniportal.service.MapAIApplication.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150) ... 引起:java.lang.NoClassDefFoundError:无法在 org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetworkHelper(ModelSerializer.java:283) 处初始化 org.nd4j.linalg.factory.Nd4j 类在 org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork( ModelSerializer.java:238) at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:222) at org.deeplearning4j.util.ModelSerializer.restoreMultiLayerNetwork(ModelSerializer.java:380) at com.myuniportal.service.MyUniPortalMapMobileAIResource(AI) Unknown Source) at com.myuniportal.service.MapAIApplication.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown) Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150) ... 36 more 36 更多

I fixed this by copying dlls from jars to a folder pointed to in the path.我通过将 dll 从 jar 复制到路径中指向的文件夹来解决此问题。 I hope this answer helps others.我希望这个答案可以帮助其他人。 -Tony -托尼

Deeplearning4j maintainer here. Deeplearning4j 维护者在这里。 You should never need to do this and I hope folks don't actually do this in the future.你永远不需要这样做,我希望人们将来不要这样做。 Javacpp (underlying component for native components) manages all of this in a .javcpp folder and already handles this. Javacpp(本机组件的底层组件)在 .javcpp 文件夹中管理所有这些并且已经处理了这些。

If you have to do something more than add the dependency to your pom.xml/gradle file, you likely did something wrong.如果除了将依赖项添加到 pom.xml/gradle 文件之外,您还需要做其他事情,那么您可能做错了什么。

The jars already contain the dlls and load them automatically. jars 已经包含 dll 并自动加载它们。

I solved the problem (with out unjaring dlls) and was able to get a program running in eclipse.我解决了这个问题(没有 unjaring dll)并且能够在 eclipse 中运行一个程序。 I am working on getting a servlet to run right now我正在努力让 servlet 立即运行

Again, many thanks.再次,非常感谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM