pickle file must have read and readline attributes

出现这个错误很正常,因为pickle存储文件是以二进制的方式存储,因此我们在读文件的时候要指定模式为rb,你如果用了r+或者其他就会报这个错。这么简单的错误网上导出都是乱写博客,也是醉了

with open('../data/acm/edges.pkl','rb') as f:
    edges = pickle.load(f)

猜你喜欢

转载自blog.csdn.net/cobracanary/article/details/120924045