我必须播放使用
保存的模型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格式,但也没有运气。任何建议将不胜感激。