When debugging the project code today, there was an error loading the file
_pickle.UnpicklingError: could not find MARK
When using pickle deserialization, it is necessary to pre-import the class of custom class data that exists in the binary data
The principle of pickle deserialization, deserialization should be the process of restoring binary data according to a template, so you should import custom types when serializing
Solution:
Error _pickle.UnpicklingError: could not find MARK```引发是因为文件的偏移量不在开头。解决方法是拨打
f.seek(0)` before loading pickle.
Hope this works for you!