1

I am trying to read an h5 file


# 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]

but i get this error :

  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)

I get this OSError and I don't know how to solve it

  • Does this answer your question? [h5py OSError: Unable to open file (File signature not found)](https://stackoverflow.com/questions/46125758/h5py-oserror-unable-to-open-file-file-signature-not-found) – EugeneProut Feb 16 '20 at 17:46
  • Just check if it got downloaded properly or not. You can download it again or simply use https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.io.loadmat.html for loading. – Anchal Gupta Feb 16 '20 at 17:49
  • Where did you get the file from? – Dr. Snoopy Feb 16 '20 at 19:02
  • A friend of mine sent it to me –  Feb 16 '20 at 19:15

0 Answers0