背景是用了多台电脑跑模型,结果发现复制过来的MLP模型的*.pickle文件读不好((
报错如下:
bclf = pickle.load(f_bclf)
TypeError: __randomstate_ctor() takes from 0 to 1 positional arguments but 2 were given
CSDN上没找到怎么解决,github上这篇帮助很大
https://github.com/numpy/numpy/issues/14210
大体来说,是numpy/random版本问题,服务器numpy1.24.2, 办公室电脑numpy1.22.2,前者做的pickle.dump(*),后者来pickle.load(*), __randomstate_ctor()的参数个数超了。pycharm里手动更新了一下(好像)没好。
看代码的话差别大概这样:
用来dump的:*\site-packages\numpy\random\_pickle.py
def __randomstate_ctor(bit_generator_name="MT19937",
bit_generator_ctor=__bit_generator_ctor):
"""