在spark

时间:2017-09-15 11:22:20

标签: apache-spark serialization pyspark keras pickle

我必须播放使用

保存的模型
model.save('my_model.h5')

将模型广播为

sc.broadcast((load_model('my_model.h5'))

引发以下错误:

cPickle.PicklingError: Could not serialize broadcast: Exception: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063.

我也试过保存模型的json格式,但也没有运气。任何建议将不胜感激。

0 个答案:

没有答案