Keras模型pyspark错误 [英] Keras model pyspark error
问题描述
我有一个已被腌制的keras模型,如以下博客所述.
I have a keras model that has been pickled as described in the following blog.
http://zachmoshe.com/2017/04/03 /pickling-keras-models.html
奇怪的是,当我从python以open(filename)读取数据时,在html文件上运行模型时,它按预期工作.但是,当从pyspark读取文件时,在文件上运行它时,出现以下错误:
What's strange is that, when I ran the model on an html file when read from python as open(filename), it worked as expected. But when running it on a file when read from pyspark, I am getting the following error:
AttributeError("'Model' object has no attribute '_feed_input_names'",)
推荐答案
您还必须在每个工作程序上运行make_keras_picklable()
.否则,工作节点上Model
对象的__setstate__
方法不会更新,因此不会按预期反序列化.
You have to run make_keras_picklable()
on each worker as well. Otherwise, the __setstate__
method of Model
object on worker node is not updated and thus will not be deserialized as expected.
这篇关于Keras模型pyspark错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!