Я пытаюсь сделать простой пример на целевой странице на Github of Elephas (https://github.com/maxpumperla/elephas#basic-example) после установки его с pip install elephas
как предложено. Я получаю ошибку:
Traceback (most recent call last):
File "<string>", line 1, in <module>
Traceback (most recent call last):
File "C:/Users/Tommaso/Desktop/stock_lstm/prova-elephas.py", line 32, in <module>
spark_model.fit(rdd, epochs=20, batch_size=32, verbose=0, validation_split=0.1)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\site-packages\elephas\spark_model.py", line 153, in fit
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 105, in spawn_main
self._fit(rdd, epochs, batch_size, verbose, validation_split)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\site-packages\elephas\spark_model.py", line 165, in _fit
self.start_server()
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\site-packages\elephas\spark_model.py", line 121, in start_server
self.parameter_server.start()
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\site-packages\elephas\parameter\server.py", line 87, in start
exitcode = _main(fd)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 114, in _main
self.server.start()
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start
prepare(preparation_data)
self._popen = self._Popen(self)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 225, in prepare
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 263, in run_path
return Popen(process_obj)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py", line 60, in dump
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 96, in _run_module_code
ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Tommaso\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Tommaso\Desktop\stock_lstm\prova-elephas.py", line 3, in <module>
sc = SparkContext(conf=conf)
File "C:\Users\Public\Spark\spark-2.2.0-bin-hadoop2.7\python\lib\pyspark.zip\pyspark\context.py", line 118, in __init__
File "C:\Users\Public\Spark\spark-2.2.0-bin-hadoop2.7\python\lib\pyspark.zip\pyspark\context.py", line 180, in _do_init
File "C:\Users\Public\Spark\spark-2.2.0-bin-hadoop2.7\python\lib\pyspark.zip\pyspark\context.py", line 273, in _initialize_context
File "C:\Users\Public\Spark\spark-2.2.0-bin-hadoop2.7\python\lib\py4j-0.10.4-src.zip\py4j\java_gateway.py", line 1401, in __call__
File "C:\Users\Public\Spark\spark-2.2.0-bin-hadoop2.7\python\lib\py4j-0.10.4-src.zip\py4j\protocol.py", line 319, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.
: org.apache.spark.SparkException: Only one SparkContext may be running in this JVM (see SPARK-2243). To ignore this error, set spark.driver.allowMultipleContexts = true. The currently running SparkContext was created at:
org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:247)
py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
py4j.Gateway.invoke(Gateway.java:236)
py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80)
py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69)
py4j.GatewayConnection.run(GatewayConnection.java:214)
java.lang.Thread.run(Thread.java:745)
at org.apache.spark.SparkContext$$anonfun$assertNoOtherContextIsRunning$2.apply(SparkContext.scala:2472)
at org.apache.spark.SparkContext$$anonfun$assertNoOtherContextIsRunning$2.apply(SparkContext.scala:2468)
at scala.Option.foreach(Option.scala:257)
at org.apache.spark.SparkContext$.assertNoOtherContextIsRunning(SparkContext.scala:2468)
at org.apache.spark.SparkContext$.markPartiallyConstructed(SparkContext.scala:2557)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:85)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:247)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:236)
at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80)
at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69)
at py4j.GatewayConnection.run(GatewayConnection.java:214)
at java.lang.Thread.run(Thread.java:745)
Я не знаю, с чего начать, я новичок. Я пытался провести какое-то исследование, но у каждой проблемы есть своя история с не очень ясными решениями, также кажется, что эта библиотека не очень популярна. Спасибо!