【问题标题】:org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException in wildflyWildfly 中的 org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException
【发布时间】:2018-10-01 10:53:48
【问题描述】:

我正在将 deeplearning4j 与 JBOSS Wildfly 一起使用。我已将下面提到的所有模块放在类路径中:

<module name="org.nd4j.jackson" />
<module name="org.nd4j.nd4j-api" />
<module name="org.nd4j.nd4j-context" />
<module name="org.nd4j.nd4j-common" />
<module name="org.nd4j.nd4j-cuda-92" />
<module name="org.nd4j.nd4j-cuda-92-platform" />
<module name="org.nd4j.nd4j-native" />
<module name="org.nd4j.nd4j-native-api" />
<module name="org.nd4j.nd4j-native-platform" />
<module name="org.bytedeco.javacpp" />
<module name="org.bytedeco.javacpp-presets.cuda" />
<module name="org.bytedeco.javacpp-presets.cuda-platform" />
<module name="org.bytedeco.javacpp-presets.mkl" />
<module name="org.bytedeco.javacpp-presets.openblas" />
<module name="org.bytedeco.javacv" />
<module name="org.datavec.datavec-api" />
<module name="org.deeplearning4j.deeplearning4j-core" />
<module name="org.deeplearning4j.deeplearning4j-nlp" />
<module name="org.deeplearning4j.deeplearning4j-nn" />

我仍然收到异常 java.lang.RuntimeException:

org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException: Please ensure that you have an nd4j backend on your classpath. Please see: http://nd4j.org/getstarted.html
at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5449)
while executing the below line of code, basically where I read the model
org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.readWord2Vec(WordVectorSerializer.java:787)

知道这里会发生什么吗?

【问题讨论】:

  • 其他用户将您的问题标记为低质量和需要改进。我重新措辞/格式化您的输入,使其更易于阅读/理解。请查看我的更改以确保它们反映您的意图。如果您对我有其他问题或反馈,请随时给我留言。
  • 感谢@GhostCat
  • 我可能是错的,但可能与线性代数所需的库有关。通常我会选择 openblas ......只是尝试运行 nd4j 示例......我觉得他们会抛出同样的错误.您必须在某个地方为本机 CPU 或 GPU 配置它们..

标签: deeplearning4j dl4j nd4j


【解决方案1】:

ND4j 使用ServiceLoader 查找后端。在 Wildfly 中启用此功能,在 jboss-deployment-structure.xml 中提及 services="import"

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">  
  <deployment>  
    <dependencies>  
      <module name="module.name" services="import"/>  
    </dependencies>  
  </deployment>    
</jboss-deployment-structure> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-29
    • 1970-01-01
    • 2019-12-31
    • 2015-01-19
    相关资源
    最近更新 更多