TypeError: can't pickle fasttext_pybind.fasttext objects

312 views
Skip to first unread message

lafi...@gmail.com

unread,
Jan 28, 2020, 10:50:56 AM1/28/20
to fastText library
Hello,
I'm runing Fastext  pretrained model Model with spark, when i broadcast the model like that:

sc = SparkContext.getOrCreate()
binary_model_brodcast = sc.broadcast(binary_model)

i get this error:

Error Log:
Traceback (most recent call last):
  File "/opt/spark/python/lib/pyspark.zip/pyspark/broadcast.py", line 110, in dump
    pickle.dump(value, f, 2)
TypeError: can't pickle fasttext_pybind.fasttext objects
Traceback (most recent call last):
  File "/opt/spark/python/lib/pyspark.zip/pyspark/broadcast.py", line 110, in dump
TypeError: can't pickle fasttext_pybind.fasttext objects


Traceback (most recent call last):
  File "/opt/spark/examples/src/main/python/SparkTweet.py", line 249, in <module>
    binary_classification_model_brodcast = sc.broadcast(binary_classification_model)
  File "/opt/spark/python/lib/pyspark.zip/pyspark/context.py", line 848, in broadcast
  File "/opt/spark/python/lib/pyspark.zip/pyspark/broadcast.py", line 90, in __init__
  File "/opt/spark/python/lib/pyspark.zip/pyspark/broadcast.py", line 117, in dump
_pickle.PicklingError: Could not serialize broadcast: TypeError: can't pickle fasttext_pybind.fasttext objects


what would be the solution to fix this?
Thank you so much
Lafi Raed


Reply all
Reply to author
Forward
0 new messages