AttributeError: module ‘_pickle‘ has no attribute ‘HIGHEST_PROTOCOL‘

错误描述

Python3在使用pickle保存文件的时候,使用protocol=HIGHEST_PROTOCOL保存的时候报AttributeError: module '_pickle' has no attribute 'HIGHEST_PROTOCOL'

解决办法

protocol=HIGHEST_PROTOCOL-1替换,代码如下

with open(output_path, 'wb') as f:
    pickle.dump((save_bins, issame_list), f, -1)

参考:https://github.com/igul222/improved_wgan_training/issues/86

你可能感兴趣的:(Python修炼之路)