问题
I'm trying to restore a pickled config file from RLLib (json didn't work as shown in this post), and getting the following error:
config = pickle.load(open(f"{path}/params.pkl", "rb"))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-28-c964561b863c> in <module>
----> 1 config = pickle.load(open(f"{path}/params.pkl", "rb"))
ValueError: unsupported pickle protocol: 5
Python Version = 3.7.0
How can I open this file in 3.7?
回答1:
Use pickle5 or load it into python 3.8+ and then serialize it to a lower version of it using the protocol parameter.
来源:https://stackoverflow.com/questions/63329657/python-3-7-error-unsupported-pickle-protocol-5