正在尝试从pyspark中的文件夹加载图像
from pyspark.ml.image import ImageSchema
from pyspark.sql.functions import lit
zero_df = ImageSchema.readImages('../Transfer-Learning-
PySpark/images/o').withColumn("label",lit(0))
抛出错误
AttributeError Traceback (most recent call last)
<ipython-input-9-29c9b120f9c2> in <module>
2 from pyspark.sql.functions import lit
3
----> 4 zero_df = ImageSchema.readImages('../Transfer-Learning-
PySpark/images/o').withColumn("label",lit(0))
AttributeError: '_ImageSchema' object has no attribute 'readImages'
Python 3.8 Spark v3.0.2
自Spark 2.4以来,可以使用
image
格式直接用DataFrameReader加载图像:更多详细信息请参见here
从那时起
ImageSchema.readImages
的用法一直是deprecated,该方法已在Spark 3.0.0中删除相关问题 更多 >
编程相关推荐