UnicodeDecodeError:“ascii”编解码器无法解码Spyder 3.3.2中位置1:序号不在范围(128)中的字节0x91

2024-06-26 01:41:47 发布

您现在位置:Python中文网/ 问答频道 /正文

当我想从pickle文件加载数据时出现问题。有人能帮我吗

folder = 'WavfileDataset/IHaveADream'
GT_file = groundtruthfolder+os.sep+'GT_IHaveADream_'+tag+'.txt'

if feature_extraction:
    data1,test_files1_auto = get_features_per_song(folder,GT_file)

    output = open('data1_pitchGT.pkl', 'wb')
    pickle.dump(data1, output)
    output.close()

pkl_file = open('data1_pitchGT.pkl', 'rb') 
data1 = pickle.load(pkl_file)

GT1,test_files1 = get_onlyGT(folder, GT_file)

我得到这个错误:

UnicodeDecodeError: 'ascii' codec can't decode byte 0x91 in position 1: ordinal not in range(128)


Tags: 文件intestgtoutputgetopenfolder