OSError:无法打开文件(未找到文件签名)h5文件

2024-09-30 10:39:52 发布

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

我正在尝试读取h5文件


# Reads the Training data file. However, this just reads the speaker list data required for encoding the targets with scikit-learn block "LabelEncoder".
dataServer = h5py.File('Librispeech_960_train_list.h5', 'r')
sLabels=dataServer['lSpeaker'][:]

encoder_spk = LabelEncoder()
encoder_spk.fit(sLabels)
num_spk_class=np.unique(sLabels).shape[0]

但是我得到了这个错误:

  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper

  File "h5py\h5f.pyx", line 85, in h5py.h5f.open

OSError: Unable to open file (file signature not found)

我发现了这个错误,我不知道如何解决它


Tags: theencoderdataobjects错误withspklist

热门问题