-2

为了运行 H2O,我刚刚从我的 Mac 中删除了 Java 16(降级到 Java 11)。H2O集群运行后终于可以连接了h2o.init()

但是,我在尝试使用h2o.importFile(). 我已检查该文件是否在我的 R 默认工作目录中,并且运行read.csv()相同文件的工作正常。有谁知道解决这个问题?非常感谢您的帮助!

爪哇版:

java版本“11.0.10”2021-01-19 LTS。
Java(TM) SE 运行时环境 18.9(内部版本 11.0.10+8-LTS-162)。
Java HotSpot(TM) 64 位服务器 VM 18.9(内部版本 11.0.10+8-LTS-162,混合模式)

输入的代码是:

sample <- read.csv("sample_csv.csv") #able to read file

library(h2o)
h2o.init()
data.h2o <- h2o.importFile("sample_csv.csv") #error

错误信息:

Connection successful!

R is connected to the H2O cluster:   
    H2O cluster uptime:         13 hours 41 minutes   
    H2O cluster timezone:       Asia/Singapore   
    H2O data parsing timezone:  UTC   
    H2O cluster version:        3.32.0.1   
    H2O cluster version age:    5 months and 21 days !!!   
    H2O cluster name:           H2O_started_from_R_User_pmr248   
    H2O cluster total nodes:    1   
    H2O cluster total memory:   4.00 GB   
    H2O cluster total cores:    16   
    H2O cluster allowed cores:  16   
    H2O cluster healthy:        TRUE   
    H2O Connection ip:          localhost   
    H2O Connection port:        54321   
    H2O Connection proxy:       NA   
    H2O Internal Security:      FALSE   
    H2O API Extensions:         Amazon S3, XGBoost, Algos, AutoML, Core V3, TargetEncoder, Core V4   
    R Version:                  R version 4.0.4 (2021-02-15)   

Your H2O cluster version is too old (5 months and 21 days)!  
Please download and install the latest version from http://h2o.ai/download/. 

ERROR: Unexpected HTTP Status code: 404 Not Found (url = http://localhost:54321/3/ImportFiles?path=sample_csv.csv&pattern=)

water.exceptions.H2ONotFoundArgumentException
 [1] "water.exceptions.H2ONotFoundArgumentException: File sample_csv.csv does not exist"                           
 [2] "    water.persist.PersistNFS.importFiles(PersistNFS.java:127)"                                               
 [3] "    water.persist.PersistManager.importFiles(PersistManager.java:386)"                                       
 [4] "    water.api.ImportFilesHandler.importFiles(ImportFilesHandler.java:25)"                                    
 [5] "    jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)"                                    
 [6] "    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
 [7] "    java.base/java.lang.reflect.Method.invoke(Method.java:566)"                                              
 [8] "    water.api.Handler.handle(Handler.java:60)"                                                               
 [9] "    water.api.RequestServer.serve(RequestServer.java:470)"                                                   
[10] "    water.api.RequestServer.doGeneric(RequestServer.java:301)"                                               
[11] "    water.api.RequestServer.doGet(RequestServer.java:225)"                                                   
[12] "    javax.servlet.http.HttpServlet.service(HttpServlet.java:687)"                                            
[13] "    javax.servlet.http.HttpServlet.service(HttpServlet.java:790)"                                            
[14] "    org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)"                                  
[15] "    org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)"                              
[16] "    org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)"                       
[17] "    org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)"                      
[18] "    org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)"                        
[19] "    org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)"                               
[20] "    org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)"                        
[21] "    org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)"                       
[22] "    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)"                           
[23] "    org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)"                   
[24] "    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)"                         
[25] "    water.webserver.jetty9.Jetty9ServerAdapter$LoginHandler.handle(Jetty9ServerAdapter.java:130)"            
[26] "    org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)"                   
[27] "    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)"                         
[28] "    org.eclipse.jetty.server.Server.handle(Server.java:531)"                                                 
[29] "    org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)"                                       
[30] "    org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)"                             
[31] "    org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)"             
[32] "    org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)"                                       
[33] "    org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)"                                    
[34] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)"                  
[35] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)"                
[36] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)"               
[37] "    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)"                      
[38] "    org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)"
[39] "    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)"                        
[40] "    org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)"                         
[41] "    java.base/java.lang.Thread.run(Thread.java:834)"                                                         

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, : ERROR MESSAGE: File sample_csv.csv does not exist
4

1 回答 1

0

请尝试使用绝对路径sample_csv.csv。R 告诉 H2O 读取文件,但是 H2O 进程的当前工作目录与 R 不同,并且在 H2O 的当前工作目录中没有名为 的文件sample_csv.csv

即使使用相对路径,使这项工作可靠地工作似乎很容易,但重要的是要意识到 H2O 可能在某些不同的计算机上运行,​​其中相对路径是正确的,但它不会在 R 客户端。

于 2021-03-30T09:11:24.897 回答