Generate tfrecods in pyspark success, code as follows:
fields = []
field = StructField('seqlen', IntegerType())
fields.append(field)
field = StructField('label', ArrayType(LongType(), True))
fields.append(field)
schema = StructType(fields)
ret = []
ret.append(len(seq_list))
labels = [1 for item in seq_list]
ret.append(labels)
df = spark.createDataFrame(rdd, schema)
df.write.format("tfrecords").mode('overwrite').option("recordType", "SequenceExample").save(...)
Python tensorflow decode error,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Name: , Feature list 'label' is required but could not be found. Did you mean to include it in feature_list_dense_missing_assumed_empty or feature_list_dense_defaults?
Generate tfrecods in pyspark success, code as follows:
Python tensorflow decode error,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Name: , Feature list 'label' is required but could not be found. Did you mean to include it in feature_list_dense_missing_assumed_empty or feature_list_dense_defaults?
Python code: