是否可以在没有CUDA的情况下在H2O中建立深水/ TensorFlow模型

时间:2017-04-21 14:40:03

标签: h2o

我的目标是在机器上将H2O与没有CUDA的TensorFlow集成。

由于TensorFlow支持CPU和GPU执行,我希望在没有CUDA的情况下实现H2O / TensorFlow集成。但是我在system specifications of Deep Water中提到CUDA软件时感到非常困惑。

我曾试图在H2O Flow中建造Deep Water / TensorFlow模型,但失败了。我执行的步骤:

  1. 已下载H2O standalone JAR;
  2. 像往常一样在H2O Flow中创建数据框;
  3. 试图建立一个分别选择Deep Water和tensorflow作为算法和后端的模型;
  4. 得到以下例外:
  5. java.lang.RuntimeException: Unable to initialize the native Deep Learning backend: No backend found. Cannot build a Deep Water model.
        at hex.deepwater.DeepWaterModelInfo.setupNativeBackend(DeepWaterModelInfo.java:246)
        at hex.deepwater.DeepWaterModelInfo.(DeepWaterModelInfo.java:193)
        at hex.deepwater.DeepWaterModel.(DeepWaterModel.java:225)
        at hex.deepwater.DeepWater$DeepWaterDriver.buildModel(DeepWater.java:127)
        at hex.deepwater.DeepWater$DeepWaterDriver.computeImpl(DeepWater.java:114)
        at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169)
        at hex.deepwater.DeepWater$DeepWaterDriver.compute2(DeepWater.java:107)
        at water.H2O$H2OCountedCompleter.compute(H2O.java:1220)
        at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
        at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
        at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
        at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
        at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

    所以我的问题是:

    1. 是否有可能在没有CUDA的H2O中建立深水/ TensorFlow模型?
    2. 如果是,我该怎么办才能让它发挥作用?如果不是,还有其他选项可以在没有CUDA的情况下集成H2O和TensorFlow吗?
    3. 更新1

      我已将gpu参数设置为false,并尝试使用所有可能的后端再次构建模型。 caffe和tensorflow都产生如上所示的相同堆栈跟踪。 mxnet也失败了,但有两个不同的堆栈跟踪。

      mxnet(首次尝试构建模型):

      java.lang.RuntimeException: Unable to initialize the native Deep Learning backend: null
          at hex.deepwater.DeepWaterModelInfo.setupNativeBackend(DeepWaterModelInfo.java:246)
          at hex.deepwater.DeepWaterModelInfo.(DeepWaterModelInfo.java:193)
          at hex.deepwater.DeepWaterModel.(DeepWaterModel.java:225)
          at hex.deepwater.DeepWater$DeepWaterDriver.buildModel(DeepWater.java:127)
          at hex.deepwater.DeepWater$DeepWaterDriver.computeImpl(DeepWater.java:114)
          at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169)
          at hex.deepwater.DeepWater$DeepWaterDriver.compute2(DeepWater.java:107)
          at water.H2O$H2OCountedCompleter.compute(H2O.java:1220)
          at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
          at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
          at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
          at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
          at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

      mxnet(后续尝试):

      java.lang.RuntimeException: Unable to initialize the native Deep Learning backend: Could not initialize class deepwater.backends.mxnet.MXNetBackend$MXNetLoader
          at hex.deepwater.DeepWaterModelInfo.setupNativeBackend(DeepWaterModelInfo.java:246)
          at hex.deepwater.DeepWaterModelInfo.(DeepWaterModelInfo.java:193)
          at hex.deepwater.DeepWaterModel.(DeepWaterModel.java:225)
          at hex.deepwater.DeepWater$DeepWaterDriver.buildModel(DeepWater.java:127)
          at hex.deepwater.DeepWater$DeepWaterDriver.computeImpl(DeepWater.java:114)
          at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169)
          at hex.deepwater.DeepWater$DeepWaterDriver.compute2(DeepWater.java:107)
          at water.H2O$H2OCountedCompleter.compute(H2O.java:1220)
          at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
          at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
          at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
          at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
          at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

      更新2

      环境:

      • SW:CentOS Linux版本7.3.1611(核心版),Java HotSpot 64位服务器VM(版本25.121-b13,混合模式);
      • HW:在Xeon CPU E5-2620 v4上运行的虚拟机,具有4个内核和8 GB RAM可用。没有可用的物理GPU,lspci -vnn | grep VGA会返回00:0f.0 VGA compatible controller [0300]: VMware SVGA II Adapter [15ad:0405] (prog-if 00 [VGA controller])

      我已清除/ tmp目录并再次尝试使用mxnet。在第一次尝试时,我遇到了新的例外:

      java.lang.RuntimeException: Unable to initialize the native Deep Learning backend: /tmp/libmxnet.so: libcudart.so.8.0: cannot open shared object file: No such file or directory
          at hex.deepwater.DeepWaterModelInfo.setupNativeBackend(DeepWaterModelInfo.java:246)
          at hex.deepwater.DeepWaterModelInfo.(DeepWaterModelInfo.java:193)
          at hex.deepwater.DeepWaterModel.(DeepWaterModel.java:225)
          at hex.deepwater.DeepWater$DeepWaterDriver.buildModel(DeepWater.java:127)
          at hex.deepwater.DeepWater$DeepWaterDriver.computeImpl(DeepWater.java:114)
          at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169)
          at hex.deepwater.DeepWater$DeepWaterDriver.compute2(DeepWater.java:107)
          at water.H2O$H2OCountedCompleter.compute(H2O.java:1220)
          at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
          at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
          at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
          at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
          at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

      文件/tmp/libmxnet.so已存在,其权限为-rw-rw-r--

1 个答案:

答案 0 :(得分:-1)

第一个问题的答案如下:

你确定可以在没有GPU的情况下运行深水,它会非常慢。当您使用FLOW时,可以禁用gpu设置,如下所示(默认情况下为TRUE)

enter image description here

您也可以在FLOW单元格中将gpu设置为false,如下所示:

" gpu":false

然而,您的主要问题是没有后端(mxnet,tensorflow,caffe)可用于运行您的代码。我们确实用mxnet测试了gpu标志设置。请尝试详细了解上述错误。