我有一個帶有架構的資料框,并希望將其轉換為 tfRecords
root
|-- col1: string (nullable = true)
|-- col2: array (nullable = true)
| |-- element: string (containsNull = true)
|-- col3: array (nullable = true)
| |-- element: string (containsNull = true)
|-- col4: array (nullable = true)
| |-- element: float (containsNull = true)
|-- col5: array (nullable = true)
| |-- element: float (containsNull = true)
|-- col6: array (nullable = true)
| |-- element: integer (containsNull = true)
|-- col7: array (nullable = true)
| |-- element: string (containsNull = true)
|-- col8: array (nullable = true)
| |-- element: string (containsNull = true)
|-- col9: array (nullable = true)
| |-- element: string (containsNull = true)
我正在使用火花張量流連接器
df.write.mode("overwrite").format("tfrecords").option("recordType", "Example").save("targetpath.tf")
將資料保存到 tfrecords 時出現的錯誤
java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps
我也在databricks社區版中嘗試過類似的方法,也得到了類似的錯誤
任何人都可以在這里幫忙嗎?
uj5u.com熱心網友回復:
最可能的原因(從Maven Central 資訊判斷)是您在使用 Scala 2.12 的 Databricks 運行時上使用為 Scala 2.11 編譯的連接器。
您需要使用 DBR 6.4 進行該轉換,或者為 Scala 2.12 編譯連接器并使用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/409756.html
標籤:
上一篇:rank1張量的20個元素的切片然后重塑拋出“重塑的輸入是具有10272個值的張量,但請求的形狀需要20的倍數”
下一篇:改進適合資料集噪聲的LSTM模型
