2016-05-07 8 views
0

Ich versuche, LDA auszuführen.Kann das LDA-Modell nicht in Spark gespeichert werden?

ldaModel = (DistributedLDAModel) new LDA().setK(numTopics).setMaxIterations(1).run(corpus); 
ldaModel.save(Main.sc.sc(), saveLDAPath); 

bis jetzt alles funktioniert jedoch gut, wenn ich versuche, das Modell nach 20 Minuten zu speichern i

org.apache.spark.rpc.RpcTimeoutException: Futures timed out after [10 seconds]. This timeout is controlled by spark.executor.heartbeatInterval 
    at org.apache.spark.rpc.RpcTimeout.org$apache$spark$rpc$RpcTimeout$$createRpcTimeoutException(RpcTimeout.scala:48) 
    at org.apache.spark.rpc.RpcTimeout$$anonfun$addMessageIfTimeout$1.applyOrElse(RpcTimeout.scala:63) 
    at org.apache.spark.rpc.RpcTimeout$$anonfun$addMessageIfTimeout$1.applyOrElse(RpcTimeout.scala:59) 
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) 
    at org.apache.spark.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:76) 
    at org.apache.spark.rpc.RpcEndpointRef.askWithRetry(RpcEndpointRef.scala:101) 
    at org.apache.spark.executor.Executor.org$apache$spark$executor$Executor$$reportHeartBeat(Executor.scala:449) 
    at org.apache.spark.executor.Executor$$anon$1$$anonfun$run$1.apply$mcV$sp(Executor.scala:470) 
    at org.apache.spark.executor.Executor$$anon$1$$anonfun$run$1.apply(Executor.scala:470) 
    at org.apache.spark.executor.Executor$$anon$1$$anonfun$run$1.apply(Executor.scala:470) 
    at org.apache.spark.util.Utils$.logUncaughtExceptions(Utils.scala:1765) 
    at org.apache.spark.executor.Executor$$anon$1.run(Executor.scala:470) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:744) 
Caused by: java.util.concurrent.TimeoutException: Futures timed out after [10 seconds] 
    at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219) 
    at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223) 
    at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:107) 
    at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53) 
    at scala.concurrent.Await$.result(package.scala:107) 
    at org.apache.spark.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:75) 
    ... 14 more 

bekomme ich Funken im lokalen Modus mit Java leite, Version 1.6.1.

static SparkConf conf = new SparkConf().setAppName("LDA Example").setMaster("local"); 
static JavaSparkContext sc = new JavaSparkContext(conf); 
static SQLContext sqlContex = new org.apache.spark.sql.SQLContext(sc); 

Antwort

0

könnte sein, dies ist ralated zu: https://issues.apache.org/jira/browse/SPARK-13906 erhöhen, um die Anzahl der Kerne Sie auf Ihrem Computer mit mit [num_cores] nach .setMAster ("local"):

conf.setAppName("LDA Example").setMaster("local[2]"); 

Warum Übergeben Sie einen sparkContext an die Speichermethode mit Main.sc.sc()? Geben Sie den Pfad wie in der Dokumentation beschrieben an:

void save(java.lang.String path)