0

I am getting the problem while trying to pickle Arabic text to store it in a variable. This is code:

# load the  train data & store it..
with open('files/0007.txt', 'rb') as f:
    train_data = pickle.load(f)

Error:

UnpicklingError                           Traceback (most recent call last)
<ipython-input-5-fa360e8454ee> in <module>
      1 # load the  train data & store it in a file
      2 with open('files/0007.txt','rb') as f:
----> 3     train_data=pickle.load(f)

UnpicklingError: invalid load key, '\xd8'.
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61

1 Answers1

0
Reason : file is corrupted

Try compressing the file, upload it and then unzip on the session. It looks like the pickle file is not saved correctly when you upload/downloaded it.