TypeError: init ()得到了意外的关键字参数“参差不齐”
from collections import Container
fs = !ls /tmp/flower_photos/sample/*.jpg
uri_df = spark.createDataFrame(fs, StringType()).toDF("uri")
uri_df.show()
keras_pred_df = transformer.transform(uri_df)
所以问题是此错误 TypeError: init ()遇到了意外的关键字参数“衣衫agged”
在此行:
keras_pred_df = transformer.transform(uri_df)
完整的笔记本在此链接中: https://drive.google.com/file/d/15B_RoLy2hMTYN0momooxUJmhW8qOZ0ng/view?usp=sharing
TypeError Traceback (most recent call last)
<command-283125553983182> in <module>
4 uri_df = spark.createDataFrame(fs, StringType()).toDF("uri")
5 uri_df.show()
----> 6 keras_pred_df = transformer.transform(uri_df)
/databricks/spark/python/pyspark/ml/base.py in transform(self, dataset, params)
171 return self.copy(params)._transform(dataset)
172 else:
--> 173 return self._transform(dataset)
174 else:
175 raise ValueError("Params must be a param map but got %s." % type(params))
/local_disk0/spark-e5f610f1-7237-4c13-b797-13678ab4f87a/userFiles-4ecd8f57-be4d-421f-8819-be7bd43892bb/addedFile6225198141175559077spark_deep_learning_1_4_0_spark2_4_s_2_11-4ec64.jar/sparkdl/transformers/keras_tensor.py in _transform(self, dataset)
55 with KSessionWrap() as (sess, keras_graph):
56 tfGraph, inputTensorName, outputTensorName = self._loadTFGraph(sess=sess,
---> 57 graph=keras_graph)
58 inputGraph = TFInputGraph.fromGraph(graph=tfGraph, sess=sess,
59 feed_names=[inputTensorName],
/local_disk0/spark-e5f610f1-7237-4c13-b797-13678ab4f87a/userFiles-4ecd8f57-be4d-421f-8819-be7bd43892bb/addedFile6225198141175559077spark_deep_learning_1_4_0_spark2_4_s_2_11-4ec64.jar/sparkdl/param/shared_params.py in _loadTFGraph(self, sess, graph)
165 with graph.as_default():
166 K.set_learning_phase(0) # Inference phase
--> 167 model = load_model(self.getModelFile())
168 out_op_name = tfx.op_name(model.output, graph)
169 stripped_graph = tfx.strip_and_freeze_until([out_op_name], graph, sess,
/databricks/python/lib/python3.7/site-packages/keras/engine/saving.py in load_wrapper(*args, **kwargs)
456 os.remove(tmp_filepath)
457 return res
--> 458 return load_function(*args, **kwargs)
459
460 return load_wrapper
/databricks/python/lib/python3.7/site-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile)
548 if H5Dict.is_supported_type(filepath):
549 with H5Dict(filepath, mode='r') as h5dict:
--> 550 model = _deserialize_model(h5dict, custom_objects, compile)
551 elif hasattr(filepath, 'write') and callable(filepath.write):
552 def load_function(h5file):
/databricks/python/lib/python3.7/site-packages/keras/engine/saving.py in _deserialize_model(h5dict, custom_objects, compile)
241 raise ValueError('No model found in config.')
242 model_config = json.loads(model_config.decode('utf-8'))
--> 243 model = model_from_config(model_config, custom_objects=custom_objects)
244 model_weights_group = h5dict['model_weights']
245