在利用numpy打开文件时报错ValueError: Object arrays cannot be loaded when allow_pickle=False
代码:
import numpy as np
np.load('xxx.npy')
解决办法1:安装的版本是1.16.4,版本太高了,降级为1.16.2
conda install numpy==1.16.2
解决办法2:点击报错处numpy/lib/format.py文件,进入源代码(format.py),注释掉695行:
#if not allow_pickle:
# raise ValueError("Object arrays cannot be loaded when "
# "allow_pickle=False")
成功!
参考:https://blog.csdn.net/weixin_43817064/article/details/90671813